mirror of
https://github.com/rikkaneko/paste.git
synced 2025-06-06 16:45:41 +00:00
Add the correct content-type to response header
Signed-off-by: Joe Ma <rikkaneko23@gmail.com>
This commit is contained in:
parent
80e8aec857
commit
28330082a5
1 changed files with 8 additions and 2 deletions
10
src/index.ts
10
src/index.ts
|
@ -85,8 +85,14 @@ export default {
|
||||||
if (path === "/") {
|
if (path === "/") {
|
||||||
switch (method) {
|
switch (method) {
|
||||||
// Fetch the HTML for uploading text/file
|
// Fetch the HTML for uploading text/file
|
||||||
case "GET":
|
case "GET": {
|
||||||
return await fetch(PASTE_INDEX_HTML_URL);
|
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
|
// Create new paste
|
||||||
case "POST":
|
case "POST":
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue