Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix header matching for badly behaving servers

  • Loading branch information...
commit ff360abb19a3249d676a10119c4a0c562f725f4f 1 parent 3e559c8
@pusewicz pusewicz authored committed
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/xmlrpc/src/xmlrpc.erl
View
7 lib/xmlrpc/src/xmlrpc.erl
@@ -183,8 +183,9 @@ parse_header(Socket, Timeout, Header) ->
{error, missing_content_length};
{ok, "\r\n"} -> {ok, Header};
{ok, HeaderField} ->
- case string:tokens(HeaderField, " \r\n") of
- ["Content-Length:", ContentLength] ->
+ [HeaderName,HeaderValue|_] = string:tokens(HeaderField, " \r\n"),
+ case [string:to_lower(HeaderName), HeaderValue] of
+ ["content-length:", ContentLength] ->
case catch list_to_integer(ContentLength) of
Value when integer(Value) ->
parse_header(Socket, Timeout,
@@ -192,7 +193,7 @@ parse_header(Socket, Timeout, Header) ->
Value});
_ -> {error, {invalid_content_length, ContentLength}}
end;
- ["Connection:", "close"] ->
+ ["connection:", "close"] ->
parse_header(Socket, Timeout,
Header#header{connection = close});
_ ->
Please sign in to comment.
Something went wrong with that request. Please try again.