mirror of
https://github.com/hyperdxio/hyperdx
synced 2026-04-21 13:37:15 +00:00
fix: local mode shouldnt send authorization header from browser challenge (#1771)
Closes HDX-3477
This commit is contained in:
parent
e984e20e69
commit
4f1da03273
2 changed files with 15 additions and 2 deletions
6
.changeset/rare-guests-tease.md
Normal file
6
.changeset/rare-guests-tease.md
Normal 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
|
||||
|
|
@ -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'];
|
||||
|
|
|
|||
Loading…
Reference in a new issue