mirror of
https://github.com/pi-hole/FTL.git
synced 2026-10-08 21:39:37 +01:00
`redirect_root_handler()` only redirects / to the web home when the Host header is webserver.domain. For any other Host - the Pi-hole's IP address, a missing Host header, "pi.hole." with a trailing dot - it returned 0, which makes CivetWeb skip the remaining handlers and serve the file itself. `request_handler()`, registered for "**", never ran, so with webserver.serve_all=false (the default) an index.html, index.htm or index.lp in the webroot was still served, and an index.lp executed, while every other path outside the web home got 404. Hand those requests to `request_handler()` instead. With serve_all off / now gets 404 like any other path outside the web home; with serve_all on it returns 0 for / and CivetWeb serves the index as before. The redirect for webserver.domain is unchanged. Signed-off-by: 010011110 <duckenheim@posteo.de>