diff --git a/devel/devel-server.py b/devel/devel-server.py index e1e6cae..1c91c00 100755 --- a/devel/devel-server.py +++ b/devel/devel-server.py @@ -77,12 +77,12 @@ class MothRequestHandler(http.server.SimpleHTTPRequestHandler): "status": "success", "data": { "short": "", - "description": "Provided answer was not in list of answers" + "description": "%r was not in list of answers" % self.req.get("answer") }, } if self.req.get("answer") in puzzle.answers: - ret["data"]["description"] = "Answer is correct" + ret["data"]["description"] = "Answer %r is correct" % self.req.get("answer") self.send_response(200) self.send_header("Content-Type", "application/json") self.end_headers() diff --git a/theme/puzzle.js b/theme/puzzle.js index 23a14df..6eb5896 100644 --- a/theme/puzzle.js +++ b/theme/puzzle.js @@ -71,21 +71,16 @@ async function possiblyCorrect(answer) { // something like the github 404 page. for (let len = 0; len <= answer.length; len += 1) { if (window.puzzle.xAnchors.includes("end") && (len != answer.length)) { - console.log(` Skipping unanchored end (len=${len})`) continue } - console.log(" What about length", len) for (let pos = 0; pos < answer.length - len + 1; pos += 1) { if (window.puzzle.xAnchors.includes("begin") && (pos > 0)) { - console.log(` Skipping unanchored begin (pos=${pos})`) continue } let sub = answer.substring(pos, pos+len) let digest = await sha256Hash(sub) - console.log(" Could it be", sub, digest) if (digest == correctHash) { - console.log(" YESSS") return sub } } @@ -120,7 +115,7 @@ function submit(e) { window.data = data fetch("answer", { method: "POST", - body: new FormData(e.target), + body: data, }) .then(resp => { if (resp.ok) {