http_static: clean up http redirect generation 85/37785/1
authorDave Barach <dave@barachs.net>
Fri, 9 Dec 2022 14:07:17 +0000 (09:07 -0500)
committerDave Barach <dave@barachs.net>
Fri, 9 Dec 2022 14:07:58 +0000 (09:07 -0500)
commitc62ddb61a5963102bc9fed2f3cfc567d38caf741
treec2584c5a07dcf9373505cf313f0c3341f99a7928
parentc0a2527a83dde2c23dad2bb0d28ef4cf64da6c6c
http_static: clean up http redirect generation

Don't redirect to "favicon.ico/index.html" if you can't find
"favicon.ico".

If asked to serve up a nonexistent path, see if the path ends with a
known suffix: ".jpg, .html, .ico" etc. If it does, flunk the request
on the spot: "Error 404 Not Found." Do not issue a redirect.

This change will not break the obvious corner case: if the browser
asks for "its_a_dir.mp3/index.html" - and the file exists - the server
will produce it.

Type: improvement

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I91aad90be05b98ba2b40e240d13d71816aed4526
src/plugins/http_static/static_server.c