Hello, @TheWaWaR @vi @not-fl3 @michelk @tforgione - 2 potential high severity security vulnerability in your repository has been disclosed to huntr.
Visit report URL and validate them
https://www.huntr.dev/bounties/3-other-TheWaWaR/simple-http-server/
https://www.huntr.dev/bounties/2-other-TheWaWaR/simple-http-server/
I was building a minimal distroless container image for this program, and I realized that the release binary's size can still be reduced significantly. Stripping the binary will cut a significant amount of size off the binary:
The binary also doesn't run in Google's distroless static or base image since it cannot find libssl.
Changes
Added strip into the release profile to automatically strip the binary upon building the release.
Added openssl as a build dependency so it will be integrated into the binary, allowing the binary to run on static:nonroot.
Here's an example Dockerfile I created for it: https://github.com/k4yt3x/simple-http-server/blob/master/Dockerfile
The final image is around 11 MiB in size, which is a decent size. I can open another PR for the Dockerfile if you're interested in maintaining it in your repo too.
While experimenting with WebAssembly I found that (at least in Firefox) WebAssembly.instantiateStreaming() requires .wasm-resources to be delivered as application/wasm. Otherwise you end up with "TypeError: Response has unsupported MIME type".
Since application/wasm doesn't seem to be official, yet (https://www.iana.org/assignments/media-types/media-types.xhtml#application) I cannot expect simple-http-server to include this binding.
It would be helpful to be able to add bindings between file extensions and mime types via command line.
I encountered an error while attempting to assign a certificate. The error message states that "TLS support is not enabled during compilation of simple-http-server." I am currently using version 0.6.7 of the software. Interestingly, when I switch to version 0.6.5, I can successfully complete the assignment without any problems.
As I am using Windows 11, I would appreciate any suggestions you have to resolve this issue.
--upload-size-limit
The default setting is in bytes, but when uploading large files, it's inconvenient to set a large number of bytes. I hope to carry the letters k, m, g after the number, so as to define the file size limit for uploading. For example, 10m, for example, 1g.