mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 03:34:33 +00:00
fix(browser): land PR #26015 query-token auth for /json relay routes
Align relay HTTP /json auth with websocket auth by accepting query-param tokens, add regression coverage, and update changelog. Landed from contributor @Sid-Qin (PR #26015). Co-authored-by: SidQin-cyber <sidqin0410@gmail.com>
This commit is contained in:
@@ -332,6 +332,19 @@ describe("chrome extension relay server", () => {
|
||||
ext.close();
|
||||
});
|
||||
|
||||
it("accepts /json endpoints with relay token query param", async () => {
|
||||
const port = await getFreePort();
|
||||
cdpUrl = `http://127.0.0.1:${port}`;
|
||||
await ensureChromeExtensionRelayServer({ cdpUrl });
|
||||
|
||||
const token = relayAuthHeaders(cdpUrl)["x-openclaw-relay-token"];
|
||||
expect(token).toBeTruthy();
|
||||
const versionRes = await fetch(
|
||||
`${cdpUrl}/json/version?token=${encodeURIComponent(String(token))}`,
|
||||
);
|
||||
expect(versionRes.status).toBe(200);
|
||||
});
|
||||
|
||||
it("accepts raw gateway token for relay auth compatibility", async () => {
|
||||
const port = await getFreePort();
|
||||
cdpUrl = `http://127.0.0.1:${port}`;
|
||||
|
||||
Reference in New Issue
Block a user