From 4ccbecf480e8d2bfd381c8fb003da664a4792f9d Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Fri, 23 Apr 2021 14:33:58 -0400 Subject: [PATCH] FIX: Forward all the HTTP headers through when we bootstrap Ember CLI (#12824) --- app/assets/javascripts/discourse/lib/bootstrap-json/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/lib/bootstrap-json/index.js b/app/assets/javascripts/discourse/lib/bootstrap-json/index.js index c66e186c44..7e1e112fe9 100644 --- a/app/assets/javascripts/discourse/lib/bootstrap-json/index.js +++ b/app/assets/javascripts/discourse/lib/bootstrap-json/index.js @@ -176,13 +176,13 @@ async function handleRequest(assetPath, proxy, req, res) { req.headers["X-Discourse-Ember-CLI"] = "true"; let get = bent("GET", [200, 404, 403, 500]); let response = await get(url, null, req.headers); + res.set(response.headers); if (response.headers["x-discourse-bootstrap-required"] === "true") { req.headers["X-Discourse-Asset-Path"] = req.path; let json = await buildFromBootstrap(assetPath, proxy, req); return res.send(json); } res.status(response.status); - res.set(response.headers); res.send(await response.text()); } } catch (e) {