mirror of
https://github.com/rikkaneko/paste.git
synced 2025-06-06 16:45:41 +00:00
Remove redundant CSP header
Signed-off-by: Joe Ma <rikkaneko23@gmail.com>
This commit is contained in:
parent
28330082a5
commit
29a6da681e
2 changed files with 5 additions and 4 deletions
|
@ -42,7 +42,6 @@
|
|||
size = approx.toFixed(3) + " " + units[i];
|
||||
}
|
||||
document.getElementById("file_size").innerHTML = size;
|
||||
document.getElementById("file_title").innerText = `"${this.files[0]?.name ?? ""}"`
|
||||
}
|
||||
|
||||
document.getElementById("upload_file").addEventListener("change", update_file_size, false);
|
||||
|
|
|
@ -89,7 +89,9 @@ export default {
|
|||
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")
|
||||
res.headers.set("content-type", "text/html; charset=UTF-8");
|
||||
// Remove the default CSP header
|
||||
res.headers.delete("content-security-policy");
|
||||
return res;
|
||||
})
|
||||
}
|
||||
|
@ -168,7 +170,7 @@ export default {
|
|||
const found = path.match("/(?<uuid>[A-z0-9]+)(?:/(?<option>[A-z]+))?$");
|
||||
if (found === null) {
|
||||
return new Response("Invalid path.\n", {
|
||||
status: 422
|
||||
status: 403
|
||||
})
|
||||
}
|
||||
// @ts-ignore
|
||||
|
@ -176,7 +178,7 @@ export default {
|
|||
// UUID format: [A-z0-9]{UUID_LENGTH}
|
||||
if (uuid.length !== UUID_LENGTH) {
|
||||
return new Response("Invalid UUID.\n", {
|
||||
status: 422
|
||||
status: 442
|
||||
})
|
||||
}
|
||||
let val = await env.PASTE_INDEX.get(uuid);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue