Skip to content

Commit

Permalink
Enforce using the arsenal error in route utils
Browse files Browse the repository at this point in the history
Issue: ARSN-441
  • Loading branch information
williamlardier committed Nov 26, 2024
1 parent fc049d0 commit c95d269
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/s3routes/routesUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ export function errorHtmlResponse(
}

log.trace('sending generic html error page',
{ err });
{ error });
setCommonResponseHeaders(corsHeaders, response, log);
response.writeHead(error.code, { 'Content-type': 'text/html' });
const html: string[] = [];
Expand Down Expand Up @@ -800,9 +800,9 @@ export function errorHeaderResponse(
error = errors.InternalError.customizeDescription(err.message);

Check warning on line 800 in lib/s3routes/routesUtils.ts

View check run for this annotation

Codecov / codecov/patch

lib/s3routes/routesUtils.ts#L799-L800

Added lines #L799 - L800 were not covered by tests
}
log.trace('sending error header response',
{ err });
{ error });
setCommonResponseHeaders(corsHeaders, response, log);
response.setHeader('x-amz-error-code', err.message);
response.setHeader('x-amz-error-code', error.message);
response.setHeader('x-amz-error-message', error.description);
response.writeHead(error.code);
return response.end(() => {
Expand Down Expand Up @@ -941,9 +941,9 @@ export function redirectRequestOnError(
if (method === 'HEAD') {
return errorHeaderResponse(error, response, corsHeaders, log);
}
response.setHeader('x-amz-error-code', err.message);
response.setHeader('x-amz-error-code', error.message);
response.setHeader('x-amz-error-message', error.description);
return errorHtmlResponse(err, false, '', response, corsHeaders, log);
return errorHtmlResponse(error, false, '', response, corsHeaders, log);
}

// This is reached only for website error document (GET only)
Expand Down

0 comments on commit c95d269

Please sign in to comment.