[erlang-questions] [bug?] R12B-4 HTTP header parsing

igwan <>
Sat Sep 6 13:49:59 CEST 2008


Hi,

While testing the new erlang:decode_packet/3 I found it returns 
http_error for inputs that are allowed by RFC2616 :

1> erlang:decode_packet(httph,<<"Host: erlang.org:80\r\n\r\n">>,[]).
{ok,{http_header,14,'Host',undefined,"erlang.org:80"},
    <<"\r\n">>}
2> erlang:decode_packet(httph,<<"Host : erlang.org:80\r\n\r\n">>,[]).
{ok,{http_error,"Host : erlang.org:80\r\n"},<<"\r\n">>}

(i.e. just adding a space between the field-name and the ':' separator)

 From RFC2616 section 2.1 "Except where noted otherwise, linear white 
space (LWS) can be included between any two adjacent words (token or 
quoted-string), and between adjacent words and separators, without 
changing the interpretation of a field."

--
igwan









More information about the erlang-questions mailing list