Browse files

patch for api.facebook.com rest server compatibility

--HG--
branch : 1.2
extra : transplant_source : %BCj%F6%8B%B7%BE%F7%85V%82%95%B0c%1C%BB%95%E6%07%FD%FD
  • Loading branch information...
1 parent 0424e0d commit d907d76c5213a1b42c68f1fde3c25c3138428d3c @etrepum etrepum committed Jul 28, 2009
Showing with 8 additions and 0 deletions.
  1. +5 −0 CHANGELOG
  2. +3 −0 src/lhttpc_client.erl
View
5 CHANGELOG
@@ -1,3 +1,8 @@
+Version 1.2.5:
+* Fix for decoding chunked HTTP responses with extraneous whitespace
+ * api.facebook.com includes extra whitespace in its chunked HTTP response
+ length, e.g. "6 \r\n" instead of "6\r\n".
+
Version 1.2.4:
* Fix handling of HTTP response code 304 (patch by Ben Slavin)
View
3 src/lhttpc_client.erl
@@ -281,6 +281,9 @@ chunk_size(<<$;, _/binary>>, Chars) ->
Chars;
chunk_size(<<"\r\n", _/binary>>, Chars) ->
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]).

0 comments on commit d907d76

Please sign in to comment.