Merge pull request #824 from pikasTech/fix/issue-814-cloud-web-authorization-proxy
fix(v02): forward API key auth through cloud web
This commit is contained in:
@@ -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\"}"));
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user