Add the correct content-type to response header

Signed-off-by: Joe Ma <rikkaneko23@gmail.com>
This commit is contained in:
Joe Ma 2022-06-02 01:50:22 +08:00
parent 80e8aec857
commit 28330082a5
No known key found for this signature in database
GPG key ID: 7A0ECF5F5EDC587F

View file

@ -85,8 +85,14 @@ export default {
if (path === "/") {
switch (method) {
// Fetch the HTML for uploading text/file
case "GET":
return await fetch(PASTE_INDEX_HTML_URL);
case "GET": {
return await fetch(PASTE_INDEX_HTML_URL).then(value => {
let res = new Response(value.body, value);
// Add the correct content-type to response header
res.headers.set("Content-Type", "text/html; charset=UTF-8")
return res;
})
}
// Create new paste
case "POST":