mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Forward all the HTTP headers through when we bootstrap Ember CLI (#12824)
This commit is contained in:
@@ -176,13 +176,13 @@ async function handleRequest(assetPath, proxy, req, res) {
|
|||||||
req.headers["X-Discourse-Ember-CLI"] = "true";
|
req.headers["X-Discourse-Ember-CLI"] = "true";
|
||||||
let get = bent("GET", [200, 404, 403, 500]);
|
let get = bent("GET", [200, 404, 403, 500]);
|
||||||
let response = await get(url, null, req.headers);
|
let response = await get(url, null, req.headers);
|
||||||
|
res.set(response.headers);
|
||||||
if (response.headers["x-discourse-bootstrap-required"] === "true") {
|
if (response.headers["x-discourse-bootstrap-required"] === "true") {
|
||||||
req.headers["X-Discourse-Asset-Path"] = req.path;
|
req.headers["X-Discourse-Asset-Path"] = req.path;
|
||||||
let json = await buildFromBootstrap(assetPath, proxy, req);
|
let json = await buildFromBootstrap(assetPath, proxy, req);
|
||||||
return res.send(json);
|
return res.send(json);
|
||||||
}
|
}
|
||||||
res.status(response.status);
|
res.status(response.status);
|
||||||
res.set(response.headers);
|
|
||||||
res.send(await response.text());
|
res.send(await response.text());
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user