fix: local mode shouldnt send authorization header from browser challenge (#1771)

Closes HDX-3477
This commit is contained in:
Aaron Knudtson 2026-02-20 15:38:37 -05:00 committed by GitHub
parent e984e20e69
commit 4f1da03273
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 2 deletions

View file

@ -0,0 +1,6 @@
---
"@hyperdx/common-utils": patch
"@hyperdx/app": patch
---
fix: clickstack build fixed when running same-site origin by omitting credentials from Authorization header for local mode fetch

View file

@ -11,7 +11,10 @@ import {
QueryInputs,
} from './index';
const localModeFetch: typeof fetch = (input, init) => {
const localModeFetch: typeof fetch = (
input: RequestInfo | URL,
init?: RequestInit,
) => {
if (!init) init = {};
const url = new URL(
input instanceof URL ? input : input instanceof Request ? input.url : input,
@ -26,11 +29,15 @@ const localModeFetch: typeof fetch = (input, init) => {
delete init.headers?.['authorization'];
if (username) url.searchParams.set('user', username);
if (password) url.searchParams.set('password', password);
init.credentials = 'omit';
return fetch(`${url.toString()}`, init);
};
const standardModeFetch: typeof fetch = (input, init) => {
const standardModeFetch: typeof fetch = (
input: RequestInfo | URL,
init?: RequestInit,
) => {
if (!init) init = {};
// authorization is handled on the backend, don't send this header
delete init.headers?.['Authorization'];