Commit Graph

10 Commits

Author SHA1 Message Date
lovasoa 1af44a79d0 fmt 2026-04-13 02:44:47 +02:00
Ophir LOJKINE 3af82f4857 Fix http header only page crashes (#1253)
Return errors early on invalid header values
2026-03-17 16:13:11 +01:00
Ophir LOJKINE 3eb527490e Fix HTTP status mapping for client request errors (#1240) 2026-03-13 11:11:12 +01:00
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