trikko / serverino

Small and ready-to-go http server, in D
https://trikko.github.io/serverino/
MIT License
47 stars 2 forks source link

Demon goes in error if I sending multiple requests with an empty string in Content-type #9

Closed m1dok closed 1 year ago

m1dok commented 1 year ago

If in a post request, I insert the content-type header with an empty string like " ", in line 410 of interfaces it will try to usesplitter(;)on an empty string, server throwing a core.exception.AssertError.

Even if the error is handled with a try/catch the worker restarts slowly and if in the meantime I send other similar requests the server crashes with the daemon error[deamon.d:0373] ERROR and you have to manually restart the server.

After that, I implement a length check _header["content-type"].replace(" ","").length>0 in line 406 of interface.d fixes the problem.

Since I'm not an expert in Dlang, if it's a good way to solve the problem, I make a pull request.