Skip to content

Commit

Permalink
fix: Do not remove Cache-Control end user defined header value
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonprsousa committed Nov 5, 2024
1 parent f72fda5 commit ffee7e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/moaning-master-chief.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@builder.io/qwik-city': patch
---

fix: Redirect, error, and fail request events no longer forcefully delete user-defined Cache-Control HTTP header value.
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ export function createRequestEvent(

error: (statusCode: number, message: string) => {
status = statusCode;
headers.delete('Cache-Control');
return new ErrorResponse(statusCode, message);
},

Expand All @@ -208,10 +207,6 @@ export function createRequestEvent(
}
headers.set('Location', fixedURL);
}
headers.delete('Cache-Control');
if (statusCode > 301) {
headers.set('Cache-Control', 'no-store');
}
exit();
return new RedirectMessage();
},
Expand All @@ -223,7 +218,6 @@ export function createRequestEvent(
fail: <T extends Record<string, any>>(statusCode: number, data: T): FailReturn<T> => {
check();
status = statusCode;
headers.delete('Cache-Control');
return {
failed: true,
...data,
Expand Down

0 comments on commit ffee7e3

Please sign in to comment.