From eef634bb700700d7d54134179f02577641667027 Mon Sep 17 00:00:00 2001 From: Christine Brass Date: Thu, 15 Nov 2018 16:40:13 -0800 Subject: [PATCH] Allow setting of response headers during redirects (#1216) --- packages/gluestick/src/renderer/middleware.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/gluestick/src/renderer/middleware.js b/packages/gluestick/src/renderer/middleware.js index f1d967d9..71e78265 100644 --- a/packages/gluestick/src/renderer/middleware.js +++ b/packages/gluestick/src/renderer/middleware.js @@ -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}`,