fix content type

This commit is contained in:
Roy Olav Purser 2022-03-05 23:51:03 +01:00
parent cd5894429c
commit a524535c32
Signed by: roypur
GPG Key ID: E14D26A036F21656
2 changed files with 3 additions and 3 deletions

View File

@ -7,7 +7,7 @@
"48": "icon-48.png", "48": "icon-48.png",
"128": "icon-128.png" "128": "icon-128.png"
}, },
"version": "107.0", "version": "108.0",
"manifest_version": 3, "manifest_version": 3,
"host_permissions": ["http://127.0.0.1:4000/jsonrpc"], "host_permissions": ["http://127.0.0.1:4000/jsonrpc"],
"permissions": ["tabs"], "permissions": ["tabs"],

View File

@ -8,7 +8,7 @@ providers.set("seafile.purser.it", "seafile")
const random = () => { const random = () => {
const arr = new Uint8Array(32) const arr = new Uint8Array(32)
window.crypto.getRandomValues(arr) window.crypto.getRandomValues(arr)
return btoa(arr) return [...arr].map(x => x.toString(16).padStart(2, "0")).join("")
} }
document.addEventListener("DOMContentLoaded", () => { document.addEventListener("DOMContentLoaded", () => {
@ -75,7 +75,7 @@ document.addEventListener("DOMContentLoaded", () => {
method: "POST", method: "POST",
body: JSON.stringify(req), body: JSON.stringify(req),
headers: { headers: {
"Content-Type": "application/json charset=utf-8" "Content-Type": "application/json; charset=utf-8"
} }
}).then(resp => console.log(resp)) }).then(resp => console.log(resp))
} catch(e) { } catch(e) {