rename/reuse variables

This commit is contained in:
2025-02-02 16:08:26 +00:00
parent 302b988bcf
commit 604a546336
+3 -3
View File
@@ -197,15 +197,15 @@ async function ebs(request, env) {
async function serve_static(request, env) { async function serve_static(request, env) {
/** @type {Response} */ /** @type {Response} */
const response = await env.static.fetch(request) let response = await env.static.fetch(request)
if (!response.ok) { if (!response.ok) {
return response return response
} }
const blob = await response.blob() response = await response.text()
if(url.pathname.endsWith('js')){ if(url.pathname.endsWith('js')){
headers.set('content-type','text/javascript') headers.set('content-type','text/javascript')
} }
return newResponse(blob) return newResponse(response)
} }
export default { export default {