atagen

jelq

public

an http based roguelike rpg about jelqing

Star0
Watch0

Commit cddf59e37d5f

tarball

atagen <boss@atagen.co>2026-10-13 12:38 UTC

1 file changed+3-4
ui: clear the excuse after it is sent

The last excuse stayed in the Authorization box, and since a datalist filters on what is typed, the box only ever offered that one excuse again. The Digest template it was refilled with at Nan's blocked the list the same way, so the nonce now goes in the placeholder instead.
Modified file: src/ui.html+3 additions−4 deletions
@@ -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 {