Files
2026-02-05 15:27:49 +08:00

13 lines
234 B
JavaScript

function handleResponse(body, status = 200, headers = {}) {
if (body !== null) {
headers["content-length"] = body.length.toString();
}
return new Response(body, {
status,
headers
});
}
export {
handleResponse
};