Skip to content

Commit

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

(cherry picked from commit 9e89a96)
  • Loading branch information
pzl committed Aug 25, 2023
1 parent 4de4586 commit 0ab67d0
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 0ab67d0

Please sign in to comment.