mirror of
https://github.com/lifegpc/eh-downloader.git
synced 2026-07-08 01:31:00 +08:00
Fix ffi database return big int
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { toJSON } from "../utils.ts";
|
||||
|
||||
export function get_ws_host() {
|
||||
const protocol = document.location.protocol === "https:" ? "wss:" : "ws:";
|
||||
return `${protocol}//${document.location.host}`;
|
||||
@@ -23,7 +25,7 @@ function gen_response<T>(
|
||||
}
|
||||
const h = new Headers(headers);
|
||||
h.set("Content-Type", "application/json; charset=UTF-8");
|
||||
return new Response(JSON.stringify(d), { status, headers: h });
|
||||
return new Response(toJSON(d), { status, headers: h });
|
||||
}
|
||||
|
||||
export function return_error<T = unknown>(
|
||||
@@ -55,7 +57,7 @@ export function gen_error<T = unknown>(
|
||||
}
|
||||
|
||||
export function return_json<T = unknown>(data: T, status = 200) {
|
||||
return new Response(JSON.stringify(data), {
|
||||
return new Response(toJSON(data), {
|
||||
status,
|
||||
headers: { "Content-Type": "application/json; chatset=UTF-8" },
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user