fix: fix review comments, again😉

- Remove unnecessary auth header name check
- Extract operations on headers into a function
This commit is contained in:
xiaoli 2025-05-25 11:17:37 +08:00
commit 2870441fea

View file

@ -301,9 +301,6 @@ export function useConnection({
// Add custom header name as a special request header to let the server know which header to pass through
if (authHeaderName.toLowerCase() !== "authorization") {
headers[authHeaderName] = token;
if (headerName) {
headers["x-custom-auth-header"] = headerName;
}
} else {
headers[authHeaderName] = `Bearer ${token}`;
}