mirror of
https://github.com/bknd-io/bknd/
synced 2026-08-03 16:46:00 +00:00
test(auth, api): ensure bearer token is case-insensitive
This commit is contained in:
@@ -70,4 +70,10 @@ describe("Api", async () => {
|
||||
expect(params.token_transport).toBe("header");
|
||||
expect(params.host).toBe("http://another.com");
|
||||
});
|
||||
|
||||
it("should extract tokens case insensitive", async () => {
|
||||
const token = await sign({ sub: "test" }, "1234");
|
||||
expect(new Api({ headers: new Headers({ Authorization: `Bearer ${token}` }) }).getAuthState().token).toBe(token);
|
||||
expect(new Api({ headers: new Headers({ Authorization: `bearer ${token}` }) }).getAuthState().token).toBe(token);
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user