Created
June 26, 2022 09:46
-
-
Save ChenYFan/7c501356414e3dce7ff05f3f7f6b219e to your computer and use it in GitHub Desktop.
Fix Wrong Header Support
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const buffer = await res.arrayBuffer() | |
if(urlStr.match(/\.html$/g) || urlStr.match(/\.htm$/g)){ | |
return new Response(buffer,{ | |
status: 200, | |
headers: { | |
'Content-Type': 'text/html;chartset=utf-8' | |
} | |
}) | |
}else{ | |
return res | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment