Skip to content
This repository has been archived by the owner on Aug 5, 2020. It is now read-only.

Commit

Permalink
Allow setting of response headers during redirects (#1216)
Browse files Browse the repository at this point in the history
  • Loading branch information
christinebrass authored Nov 16, 2018
1 parent cb45750 commit eef634b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/gluestick/src/renderer/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ const middleware: Middleware = async (req, res, { assets }) => {
callHook(hooks.preRedirect, redirectLocation);
const status =
(redirectLocation.state && redirectLocation.state.status) || 301;
const headers = redirectLocation.state && redirectLocation.state.headers;
if (headers) {
res.set(headers);
}
res.redirect(
status,
`${redirectLocation.pathname}${redirectLocation.search}`,
Expand Down

0 comments on commit eef634b

Please sign in to comment.