Skip to content

Commit

Permalink
feat: Add fallback Cache-Control header value for redirects > http 301
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonprsousa authored Nov 6, 2024
1 parent 75a27f9 commit d30d2f3
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ export function createRequestEvent(
}
headers.set('Location', fixedURL);
}
// Fallback to 'no-store' when end user is not managing Cache-Control header
if (statusCode > 301 && !headers.get('Cache-Control')) {
headers.set('Cache-Control', 'no-store');
}
exit();
return new RedirectMessage();
},
Expand Down

0 comments on commit d30d2f3

Please sign in to comment.