Commit Graph

7 Commits

Author SHA1 Message Date
lovasoa 7399b1084a Fix basic auth test assertions
Use "Unauthorized" instead of "not authorized" to match the expected
response.

Add tests for basic auth error cases.
2025-09-15 14:01:28 +02:00
lovasoa ddd52fd74c Refactor unauthorized response
Use ErrorWithStatus for unauthorized errors to set the WWW-Authenticate
header.
2025-09-15 11:34:23 +02:00
Ophir LOJKINE 33125565d3 Check for 404 before redirecting on no-extension paths (#972)
* Check for 404 before redirecting on no-extension paths

The commit improves routing logic by checking if a path would result in
a 404

fixes https://github.com/sqlpage/SQLPage/issues/971 before adding a
trailing slash. This prevents unnecessary redirects when a custom 404
handler exists.

* Fix test function signature formatting in routing module (#973)

Co-authored-by: Cursor Agent <cursoragent@cursor.com>

* Simplify path resolution and redirect logic

The shorter code more clearly handles finding files with .sql extensions
and decides whether to add trailing slashes based on index file
presence.

* clippy

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2025-07-28 17:54:23 +02:00
lovasoa 7da1b2882a implement default 404 error page
... and update routing logic to serve it; remove old 404 handling code; add tests for new behavior
2025-05-29 22:44:22 +02:00
lovasoa 2d307fa6f0 move 404 test 2025-05-25 23:31:58 +02:00
lovasoa acdc03891d clippy fixes 2025-05-25 23:22:41 +02:00
lovasoa 5cbd12fcfd reorganize tests: better structure 2025-05-25 23:20:31 +02:00