Bob Ippolito  committed bc6af68

patch for rest server compatibility

  • Participants
  • Parent commits da15f9c

Comments (0)

Files changed (2)

 Version ?:
+* Fix for decoding chunked HTTP responses with extraneous whitespace
+    * includes extra whitespace in its chunked HTTP response
+      length, e.g. "6  \r\n" instead of "6\r\n".
 * Fix for unexpected messages after request has been completed
     * When the client process is trapping exits (which some eunit versions seem
       to be doing by default) there would be {'EXIT', Pid, normal} messages left

File src/lhttpc_client.erl

 chunk_size(<<"\r\n", _/binary>>, Chars) ->
+chunk_size(<<$\s, Binary/binary>>, Chars) ->
+    %% Facebook's HTTP server returns a chunk size like "6  \r\n"
+    chunk_size(Binary, Chars);
 chunk_size(<<Char, Binary/binary>>, Chars) ->
     chunk_size(Binary, [Char | Chars]).