mkantor / operator

A web server for static and dynamic content.
https://operator.mattkantor.com
GNU General Public License v3.0
16 stars 2 forks source link

`OPTIONS *` requests cause panics #92

Closed mkantor closed 2 years ago

mkantor commented 2 years ago

To reproduce:

cargo run -- serve -vvv --content-directory=samples/realistic-basic --bind-to=127.0.0.1:8080
curl -X OPTIONS --request-target '*' http://localhost:8080

For more info on this somewhat-special type of request, see this MDN page.

mkantor commented 2 years ago

The same panic occurs if you send malformed HTTP requests where the path does not begin with /. I believe that OPTIONS * is the only spec-compliant situation where that happens, but Operator should probably handle garbage requests more gracefully too.