elli-lib / elli

Simple, robust and performant Erlang web server
https://github.com/elli-lib/elli/blob/develop/doc/README.md
MIT License
324 stars 38 forks source link

case-sensitive "keep-alive" causes errors #117

Closed CharlesOkwuagwu closed 1 year ago

CharlesOkwuagwu commented 1 year ago

These clauses are case-sensitive. That can lead to problems like the one I just caught.

[14:44:05.119] Elli request (pid #PID<0.407.0>) unexpectedly crashed:

{{:case_clause, "keep-alive"},
 [
   {:elli_http, :close_or_keepalive, 2,
    [file: ~c"c:/Projects/elli-4.0.0/src/elli_http.erl", line: 687]},
   {:elli_http, :handle_response, 3,
    [file: ~c"c:/Projects/elli-4.0.0/src/elli_http.erl", line: 148]},
   {:elli_http, :keepalive_loop, 5,
    [file: ~c"c:/Projects/elli-4.0.0/src/elli_http.erl", line: 83]},
   {:proc_lib, :init_p_do_apply, 3, [file: ~c"proc_lib.erl", line: 241]}
 ]}
tsloughter commented 1 year ago

Thanks, yea, it should probably downcase all headers when reading the request in the first place.