knutin / elli

Simple, robust and performant Erlang web server
MIT License
663 stars 79 forks source link

Handle HttpError when using get_headers in elli_http #65

Closed sthadka closed 11 years ago

sthadka commented 11 years ago

Add http_error clause when using get_headers to prevent errors such as:

May 26 08:08:01 live-erlang app@server:  <0.138.0> Elli request (pid <0.18293.808>) unexpectedly crashed:
{{case_clause,{ok,{http_error,<<67,111,110,110,116,45,116,0,0,121,112,101,58,32,97,112,112,108,105,99,97,116,105,111,110,47,120,45,119,119,119,45,102,111,114,109,45,117,114,108,101,110,99,111,100,101,100,13,10>>},<<"Content-length: 320\r\n\r\n">>}},[{elli_http,get_headers,6,[{file,"src/elli_http.erl"},{line,350}]},{elli_http,handle_request,4,[{file,"src/elli_http.erl"},{line,67}]},{elli_http,keepalive_loop,5,[{file,"src/elli_http.erl"},{line,52}]}]}