Skip to content

Commit

Permalink
[8.10] [Security Solution] ensure fleetfilenotfound is reported as a …
Browse files Browse the repository at this point in the history
…404 (elastic#164738) (elastic#164836)

# Backport

This will backport the following commits from `main` to `8.10`:
- [[Security Solution] ensure fleetfilenotfound is reported as a 404
(elastic#164738)](elastic#164738)

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Dan
Panzarella","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-08-24T19:48:10Z","message":"[Security
Solution] ensure fleetfilenotfound is reported as a 404
(elastic#164738)","sha":"9e89a9694b9bacc275f8d2125200b53447a13f1f","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Defend
Workflows","v8.10.0","v8.11.0"],"number":164738,"url":"https://github.com/elastic/kibana/pull/164738","mergeCommit":{"message":"[Security
Solution] ensure fleetfilenotfound is reported as a 404
(elastic#164738)","sha":"9e89a9694b9bacc275f8d2125200b53447a13f1f"}},"sourceBranch":"main","suggestedTargetBranches":["8.10"],"targetPullRequestStates":[{"branch":"8.10","label":"v8.10.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/164738","number":164738,"mergeCommit":{"message":"[Security
Solution] ensure fleetfilenotfound is reported as a 404
(elastic#164738)","sha":"9e89a9694b9bacc275f8d2125200b53447a13f1f"}}]}]
BACKPORT-->

Co-authored-by: Dan Panzarella <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
3 people authored Aug 25, 2023
1 parent 90529f8 commit 63d021f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

import type { IKibanaResponse, KibanaResponseFactory, Logger } from '@kbn/core/server';
import { FleetFileNotFound } from '@kbn/fleet-plugin/server/errors';
import { CustomHttpRequestError } from '../../utils/custom_http_request_error';
import { NotFoundError } from '../errors';
import { EndpointHostUnEnrolledError, EndpointHostNotFoundError } from '../services/metadata';
Expand Down Expand Up @@ -38,7 +39,7 @@ export const errorHandler = <E extends Error>(
});
}

if (error instanceof NotFoundError) {
if (error instanceof NotFoundError || error instanceof FleetFileNotFound) {
return res.notFound({ body: error });
}

Expand Down

0 comments on commit 63d021f

Please sign in to comment.