Skip to content

Commit

Permalink
[Security Solution] ensure fleetfilenotfound is reported as a 404 (el…
Browse files Browse the repository at this point in the history
  • Loading branch information
pzl authored Aug 24, 2023
1 parent b2308a9 commit 9e89a96
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 9e89a96

Please sign in to comment.