0xf104a / MeowMeow

Tiny webserver written in erlang
MIT License
2 stars 0 forks source link

[rules engine] Incorrect handling of absent `Hosts` header #12

Open 0xf104a opened 3 years ago

0xf104a commented 3 years ago

Describe the bug When client does HTTP/1.0 request to server with Hosts handling configured the exception on server occurs.

To Reproduce Any HTTP/1.0 request without Hosts header to MeowMeow server where Hosts handling is configured.

Expected behavior No exception should occur.

OS & client (please complete the following information): Unknown

Logs

=ERROR REPORT==== 9-Jul-2021::06:28:11.395303 ===
Error in process <0.1905.0> on node 'MeowMeow@ef6b9abe815b' with exit value:
{{badmatch,ok},
 [{handle,do_rules,2,[{file,"/buildroot/src/handle.erl"},{line,76}]},
  {handle,handle,2,[{file,"/buildroot/src/handle.erl"},{line,198}]},
  {handle,handler,3,[{file,"/buildroot/src/handle.erl"},{line,272}]}]}
0xf104a commented 3 years ago

The reason for this error is that some clients trying to do HTTP/1.1. request like if it was HTTP/1.0 request.