@inflector/aura 0.7.0 → 0.7.1
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 +12 -5
- 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,iBAqL/C;AAmRD,wBAAsB,GAAG,kBAiFxB"}
|
package/dist/bin.js
CHANGED
|
@@ -393,20 +393,23 @@ export async function serve(mode) {
|
|
|
393
393
|
target: upstreamUrl,
|
|
394
394
|
changeOrigin: false, // don't rewrite origin — breaks cookies
|
|
395
395
|
secure: false,
|
|
396
|
+
ws: true,
|
|
396
397
|
configure(proxy) {
|
|
397
398
|
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
|
|
398
401
|
proxyReq.setHeader("connection", "close");
|
|
399
402
|
if (AURA_KEY)
|
|
400
403
|
proxyReq.setHeader("Authorization", `Bearer ${AURA_KEY}`);
|
|
401
|
-
// preserve cookies
|
|
402
404
|
if (req.headers.cookie)
|
|
403
405
|
proxyReq.setHeader("cookie", req.headers.cookie);
|
|
404
406
|
});
|
|
405
407
|
proxy.on("proxyRes", (proxyRes) => {
|
|
406
408
|
// ensure set-cookie is not stripped
|
|
407
409
|
if (proxyRes.headers["set-cookie"]) {
|
|
408
|
-
proxyRes.headers["set-cookie"] = proxyRes.headers["set-cookie"]
|
|
409
|
-
.
|
|
410
|
+
proxyRes.headers["set-cookie"] = proxyRes.headers["set-cookie"].map((c) => c
|
|
411
|
+
.replace(/; secure/gi, "")
|
|
412
|
+
.replace(/; samesite=none/gi, ""));
|
|
410
413
|
}
|
|
411
414
|
});
|
|
412
415
|
},
|
|
@@ -452,11 +455,15 @@ export async function serve(mode) {
|
|
|
452
455
|
const filePath = `./dist${url.pathname}`;
|
|
453
456
|
const file = Bun.file(filePath);
|
|
454
457
|
if (await file.exists()) {
|
|
455
|
-
return new Response(file, {
|
|
458
|
+
return new Response(file, {
|
|
459
|
+
headers: { "Content-Type": getMimeType(filePath) },
|
|
460
|
+
});
|
|
456
461
|
}
|
|
457
462
|
const index = Bun.file("./dist/index.html");
|
|
458
463
|
if (await index.exists()) {
|
|
459
|
-
return new Response(index, {
|
|
464
|
+
return new Response(index, {
|
|
465
|
+
headers: { "Content-Type": "text/html" },
|
|
466
|
+
});
|
|
460
467
|
}
|
|
461
468
|
return new Response("Not Found", { status: 404 });
|
|
462
469
|
},
|