an http based roguelike rpg about jelqing
Commit cddf59e37d5f
tarball1 file changed+3-4
@@ -302,7 +302,8 @@ function renderFields() {
302302
} else if (f.kind === "textarea") {303303
input = el("textarea", { rows: 3, cols: 40, value, placeholder: f.placeholder || "" });304304
} else {305
- input = el("input", { type: f.kind, value, placeholder: f.placeholder || "", size: 30 });305
+ const hint = name === "authorization" && nonce ? 'Digest username="helping Nan", nonce="' + nonce + '"' : f.placeholder || "";306
+ input = el("input", { type: f.kind, value, placeholder: hint, size: 30 });306307
}307308
input.oninput = () => { values[name] = input.value; };308309
input.onchange = () => { values[name] = input.value; if (choices) renderFields(); };@@ -380,9 +381,6 @@ function absorb(r, sentMethod, sentPath) {
380381
const headers = Object.fromEntries(r.headers.map(([n, v]) => [n.toLowerCase(), v]));381382
if (headers.etag) etags[sentPath] = headers.etag;382383
const digest = (headers["www-authenticate"] || "").match(/nonce="([^"]*)"/);383
- if (digest && !(values.authorization || "").includes(digest[1])) {384
- values.authorization = 'Digest username="", nonce="' + digest[1] + '"';385
- }386384
if ("www-authenticate" in headers) nonce = digest ? digest[1] : null;387385
renderExcuses();388386
let body = null;@@ -467,6 +465,7 @@ async function go(event) {
467465
}468466
469467
const sent = ["> " + method + " " + short(path)].concat(headers.map(([name, v]) => "> " + name + ": " + v)).join("\n");468
+ delete values.authorization;470469
headers.push(["Accept-Language", $("locale").value]);471470
let r;472471
try {