浏览代码

Bugfix for HTTP servers that omit a reason-phrase from their HTTP response.

Some server have a status-line like "HTTP/1.1 200" instead of the more common
"HTTP/1.1 200 ok". The current ibrowse_http_client crashes on such a status-line.

This patch provides a fix.

Some HTTP servers do not
pull/16/head
Jeroen Koops 14 年前
父节点
当前提交
d094af3de6
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. +2
    -0
      src/ibrowse_http_client.erl

+ 2
- 0
src/ibrowse_http_client.erl 查看文件

@ -1364,6 +1364,8 @@ parse_status_line([32 | T], get_prot_vsn, ProtVsn, StatCode) ->
parse_status_line(T, get_status_code, ProtVsn, StatCode);
parse_status_line([32 | T], get_status_code, ProtVsn, StatCode) ->
{ok, lists:reverse(ProtVsn), lists:reverse(StatCode), T};
parse_status_line([], get_status_code, ProtVsn, StatCode) ->
{ok, lists:reverse(ProtVsn), lists:reverse(StatCode), []};
parse_status_line([H | T], get_prot_vsn, ProtVsn, StatCode) ->
parse_status_line(T, get_prot_vsn, [H|ProtVsn], StatCode);
parse_status_line([H | T], get_status_code, ProtVsn, StatCode) ->

正在加载...
取消
保存