mirror of
https://github.com/lifegpc/eh-downloader.git
synced 2026-06-06 05:38:44 +08:00
Fix 401 cause CORS not works
This commit is contained in:
@@ -29,8 +29,10 @@ function gen_response<T>(
|
||||
export function return_error<T = unknown>(
|
||||
status: Exclude<number, 0>,
|
||||
error: string,
|
||||
http_status = 200,
|
||||
headers: HeadersInit = {},
|
||||
) {
|
||||
return gen_response<T>({ ok: false, status, error });
|
||||
return gen_response<T>({ ok: false, status, error }, http_status, headers);
|
||||
}
|
||||
|
||||
export function return_data<T = unknown>(
|
||||
|
||||
Reference in New Issue
Block a user