mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 02:52:44 +08:00
DEV: Add 201 to bootstrap-json accepted status codes (#15102)
The theme creator endpoints return JSON with a 201 CREATED status code. With the recent changes to bootstrap-json/index.js for the Ember CLI proxy, these endpoints were broken because 201 was not an accepted status code. This commit simply adds 201 to the array, but prettier forced a reformat as well!
This commit is contained in:
parent
1b5f26e0ab
commit
73db60ad2a
|
@ -230,7 +230,18 @@ async function handleRequest(proxy, baseURL, req, res) {
|
|||
req.headers["X-Discourse-Asset-Path"] = req.path;
|
||||
}
|
||||
|
||||
const acceptedStatusCodes = [200, 301, 302, 303, 307, 308, 404, 403, 500];
|
||||
const acceptedStatusCodes = [
|
||||
200,
|
||||
201,
|
||||
301,
|
||||
302,
|
||||
303,
|
||||
307,
|
||||
308,
|
||||
404,
|
||||
403,
|
||||
500,
|
||||
];
|
||||
const proxyRequest = bent(req.method, acceptedStatusCodes);
|
||||
const requestBody = req.method === "GET" ? null : req.body;
|
||||
const response = await proxyRequest(url, requestBody, req.headers);
|
||||
|
|
Loading…
Reference in New Issue
Block a user