fix(v02): forward API key auth through cloud web

This commit is contained in:
Codex Agent
2026-06-04 15:54:00 +08:00
parent 53f76e8724
commit c0879ef764
2 changed files with 3 additions and 2 deletions
@@ -6,6 +6,7 @@ const STREAMING_HEADER_DEFAULTS = Object.freeze({
});
const FORWARDED_REQUEST_HEADERS = Object.freeze([
"authorization",
"cookie",
"prefer",
"x-hwlab-short-connection",
@@ -18,7 +18,7 @@ test("cloud web proxy preserves Code Agent short-connection headers", () => {
"x-trace-id": "trc_proxy_short_connection",
"x-request-id": "req_proxy_short_connection",
cookie: "hwlab_session=must-forward",
authorization: "Bearer must-not-forward"
authorization: "Bearer hwl_live_must-forward"
}
}, "{\"message\":\"hello\"}");
@@ -29,7 +29,7 @@ test("cloud web proxy preserves Code Agent short-connection headers", () => {
assert.equal(headers["x-trace-id"], "trc_proxy_short_connection");
assert.equal(headers["x-request-id"], "req_proxy_short_connection");
assert.equal(headers.cookie, "hwlab_session=must-forward");
assert.equal(headers.authorization, undefined);
assert.equal(headers.authorization, "Bearer hwl_live_must-forward");
assert.equal(headers["content-length"], Buffer.byteLength("{\"message\":\"hello\"}"));
});