preserve auth headers in json proxies

This commit is contained in:
2569718930@qq.com
2026-06-11 14:04:17 +08:00
parent 5b65da6049
commit d314aa04d7
8 changed files with 59 additions and 16 deletions
+6
View File
@@ -125,6 +125,12 @@ export function applyAuthResponseCookies(
return target;
}
export function buildJsonBackendRequestHeaders(headers: HeadersInit) {
const result = new Headers(headers);
result.set("Content-Type", "application/json");
return result;
}
export function requireBackendAuthUser(auth: BackendHeaderBuildResult) {
if (auth.authUserId) return null;
return applyAuthResponseCookies(