mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-04 20:45:40 +00:00
Net: expand cross-origin sensitive header regression test
This commit is contained in:
@@ -109,7 +109,9 @@ describe("fetchWithSsrFGuard hardening", () => {
|
|||||||
init: {
|
init: {
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: "Bearer secret",
|
Authorization: "Bearer secret",
|
||||||
|
"Proxy-Authorization": "Basic c2VjcmV0",
|
||||||
Cookie: "session=abc",
|
Cookie: "session=abc",
|
||||||
|
Cookie2: "legacy=1",
|
||||||
"X-Trace": "1",
|
"X-Trace": "1",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -118,7 +120,9 @@ describe("fetchWithSsrFGuard hardening", () => {
|
|||||||
const [, secondInit] = fetchImpl.mock.calls[1] as [string, RequestInit];
|
const [, secondInit] = fetchImpl.mock.calls[1] as [string, RequestInit];
|
||||||
const headers = new Headers(secondInit.headers);
|
const headers = new Headers(secondInit.headers);
|
||||||
expect(headers.get("authorization")).toBeNull();
|
expect(headers.get("authorization")).toBeNull();
|
||||||
|
expect(headers.get("proxy-authorization")).toBeNull();
|
||||||
expect(headers.get("cookie")).toBeNull();
|
expect(headers.get("cookie")).toBeNull();
|
||||||
|
expect(headers.get("cookie2")).toBeNull();
|
||||||
expect(headers.get("x-trace")).toBe("1");
|
expect(headers.get("x-trace")).toBe("1");
|
||||||
await result.release();
|
await result.release();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user