From 581bbe2dfa83d14430209f48b9c615b44c26542a Mon Sep 17 00:00:00 2001 From: Akita Noek Date: Thu, 2 Nov 2023 04:59:31 -0600 Subject: [PATCH] Add application/json header to gulp proxy if it doesn't exist Not sure why this is needed when proxying, but it seems to be now that we've switched to fetch based requests. --- Gulpfile.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Gulpfile.js b/Gulpfile.js index ee13ef0334..b5e5b6b4f2 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -227,6 +227,14 @@ function dev_server(done) { console.log("-->", path); return path; }, + proxyReqOptDecorator: function (proxyReqOpts, srcReq) { + return new Promise(function (resolve, reject) { + if (!("Content-Type" in srcReq.headers)) { + proxyReqOpts.headers["Content-Type"] = "application/json"; + } + resolve(proxyReqOpts); + }); + }, }); devserver.use("/api", backend_proxy("/api"));