@inflector/aura 0.7.1 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.d.ts.map +1 -1
- package/dist/bin.js +10 -9
- package/package.json +1 -1
package/dist/bin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AAmLA,wBAAgB,KAAK,CAAC,MAAM,UAAQ,QAgDnC;AAwJD,wBAAsB,KAAK,CAAC,IAAI,EAAE,KAAK,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AAmLA,wBAAgB,KAAK,CAAC,MAAM,UAAQ,QAgDnC;AAwJD,wBAAsB,KAAK,CAAC,IAAI,EAAE,KAAK,GAAG,MAAM,iBAoL/C;AAmRD,wBAAsB,GAAG,kBAiFxB"}
|
package/dist/bin.js
CHANGED
|
@@ -391,25 +391,26 @@ export async function serve(mode) {
|
|
|
391
391
|
proxy: {
|
|
392
392
|
"/api": {
|
|
393
393
|
target: upstreamUrl,
|
|
394
|
-
changeOrigin: false,
|
|
394
|
+
changeOrigin: false,
|
|
395
395
|
secure: false,
|
|
396
396
|
ws: true,
|
|
397
|
+
rewrite: (path) => path, // identity — no rewrite, keep as-is
|
|
397
398
|
configure(proxy) {
|
|
398
399
|
proxy.on("proxyReq", (proxyReq, req) => {
|
|
399
|
-
// Rewrite the path using the raw unmodified URL from the request
|
|
400
|
-
proxyReq.path = req.url; // ← keeps the original encoding intact
|
|
401
400
|
proxyReq.setHeader("connection", "close");
|
|
402
401
|
if (AURA_KEY)
|
|
403
402
|
proxyReq.setHeader("Authorization", `Bearer ${AURA_KEY}`);
|
|
404
403
|
if (req.headers.cookie)
|
|
405
404
|
proxyReq.setHeader("cookie", req.headers.cookie);
|
|
406
405
|
});
|
|
407
|
-
proxy.on("
|
|
408
|
-
|
|
409
|
-
if (
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
406
|
+
proxy.on("error", (err, req, res) => {
|
|
407
|
+
console.error("[proxy error]", err.message, req.url);
|
|
408
|
+
if (!res.headersSent) {
|
|
409
|
+
res.writeHead(502, { "Content-Type": "application/json" });
|
|
410
|
+
res.end(JSON.stringify({
|
|
411
|
+
error: "Proxy error",
|
|
412
|
+
detail: err.message,
|
|
413
|
+
}));
|
|
413
414
|
}
|
|
414
415
|
});
|
|
415
416
|
},
|