@mupt-ai/dari-gateway 1.0.314 → 1.0.315
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.
|
@@ -55,10 +55,14 @@ async function handleRequest(incoming, outgoing, handler) {
|
|
|
55
55
|
const response = await handler(toRequest(incoming, abort.signal));
|
|
56
56
|
outgoing.statusCode = response.status;
|
|
57
57
|
for (const [name, value] of response.headers) {
|
|
58
|
-
if (!HTTP2_FORBIDDEN_RESPONSE_HEADERS.has(name
|
|
58
|
+
if (name !== "set-cookie" && !HTTP2_FORBIDDEN_RESPONSE_HEADERS.has(name)) {
|
|
59
59
|
outgoing.setHeader(name, value);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
+
// Headers yields each cookie on its own, so setting them one by one keeps only the last.
|
|
63
|
+
const cookies = response.headers.getSetCookie();
|
|
64
|
+
if (cookies.length > 0)
|
|
65
|
+
outgoing.setHeader("set-cookie", cookies);
|
|
62
66
|
if (response.body === null || incoming.method === "HEAD") {
|
|
63
67
|
outgoing.end();
|
|
64
68
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mupt-ai/dari-gateway",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.315",
|
|
4
4
|
"description": "Self-hostable LLM gateway for coding agents and APIs: one endpoint for Anthropic Messages, OpenAI Chat Completions, and OpenAI Responses, with subscription pooling, failover, and prompt-cache-aware routing.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@aws-sdk/client-sts": "3.1063.0",
|
|
55
|
-
"@mupt-ai/dari-router": "1.0.
|
|
55
|
+
"@mupt-ai/dari-router": "1.0.315",
|
|
56
56
|
"@mupt-ai/pi-ai": "1.5.2-mupt.1"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
package/src/http/http2_server.ts
CHANGED
|
@@ -75,10 +75,13 @@ async function handleRequest(
|
|
|
75
75
|
const response = await handler(toRequest(incoming, abort.signal));
|
|
76
76
|
outgoing.statusCode = response.status;
|
|
77
77
|
for (const [name, value] of response.headers) {
|
|
78
|
-
if (!HTTP2_FORBIDDEN_RESPONSE_HEADERS.has(name
|
|
78
|
+
if (name !== "set-cookie" && !HTTP2_FORBIDDEN_RESPONSE_HEADERS.has(name)) {
|
|
79
79
|
outgoing.setHeader(name, value);
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
+
// Headers yields each cookie on its own, so setting them one by one keeps only the last.
|
|
83
|
+
const cookies = response.headers.getSetCookie();
|
|
84
|
+
if (cookies.length > 0) outgoing.setHeader("set-cookie", cookies);
|
|
82
85
|
if (response.body === null || incoming.method === "HEAD") {
|
|
83
86
|
outgoing.end();
|
|
84
87
|
return;
|