Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Check a failure flag that follows a question mark
A failed login on a page with no query of its own comes back as
?login=failed, the common case, but only the &login=failed form was
tried. A drop_failure_flag that handled the ampersand alone would have
lost the message and piled flags onto the way back, and passed.
Diffstat (limited to 'tests/extensions')
| -rw-r--r-- | tests/extensions/test-auth.lua | 5 |
1 file changed, 5 insertions, 0 deletions
diff --git a/tests/extensions/test-auth.lua b/tests/extensions/test-auth.lua index d6982a4..111fbbb 100644 --- a/tests/extensions/test-auth.lua +++ b/tests/extensions/test-auth.lua @@ -489,6 +489,11 @@ out = run_action("body", { url = "/repo/log/?q=x&login=failed" }) h.contains("a failed login says so", out, "<p class='login-error' role='alert'>Wrong username or password.</p>") h.equals("and leaves the flag out of the way back", way_back_in(out), "/repo/log/?q=x") +-- A page with no query of its own comes back flagged after a question mark. +out = run_action("body", { url = "/repo/?login=failed" }) +h.contains("a flag after a question mark says so too", out, + "<p class='login-error' role='alert'>Wrong username or password.</p>") +h.equals("and leaves the flag and its mark out of the way back", way_back_in(out), "/repo/") -- The real get_secret, pointed at a directory nobody made, cannot sign the -- way back, so the page says so whole rather than breaking off in the form. |
