basic-http-server
basic-http-server copied to clipboard
Multiple Improvements
I've bundled up all my previous PRs into a single PR and added basic auth. I needed all this stuff for some use of my own, but hope that the work is useful to others. This PR includes
- Protection against accessing files or folders outside of the root directory (and a switch to turn it off)
- Turn a panic into an error when a socket is already in use.
- URLs not found are redirected to root, unless they look like a file. The 'unless they look like a file' part I added because I found it confusing when I'd misspelled a file name and got the index.html rather than a not found.
- A very liberal impl of basic http auth, which will accept empty usernames, passwords. This isn't designed to be secure: I intent to use it to keep a website embargoed, but I don't care if someone guesses the password: there isn't anything private on the website. It shouldn't be used for securing things properly.
Closes #23 Closes #22 Closes #19
Patiently awaiting these improvements 👍
Pingy ping :slightly_smiling_face:
Hi @brson hope you don't mind another ping. I promise it's an easy to review PR. :)