From 288f54c8f4f7cac0951f0807e4a6d3b59c099156 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Thu, 10 Jun 2010 15:56:12 +0200 Subject: {packet,http} allow empty response phrase Packet type 'http' for erlang:deocode:packet and gen_tcp allow a response line with an empty phrase string, like "HTTP/1.1 200\r\n". Earlier, an empty phrase was only accepted if the status code was followed by space or tab, like "HTTP/1.1 200 \r\n". --- erts/emulator/test/decode_packet_SUITE.erl | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'erts/emulator/test') diff --git a/erts/emulator/test/decode_packet_SUITE.erl b/erts/emulator/test/decode_packet_SUITE.erl index 6cde286871..d9e961be2f 100644 --- a/erts/emulator/test/decode_packet_SUITE.erl +++ b/erts/emulator/test/decode_packet_SUITE.erl @@ -304,6 +304,10 @@ http(Config) when is_list(Config) -> {ok, {http_request, 'GET', ResB, {1,1}}, Rest} = decode_pkt(http_bin,Bin) end, lists:foreach(UriF, http_uri_variants()), + + %% Response with empty phrase + ?line {ok,{http_response,{1,1},200,[]},<<>>} = decode_pkt(http, <<"HTTP/1.1 200\r\n">>, []), + ?line {ok,{http_response,{1,1},200,<<>>},<<>>} = decode_pkt(http_bin, <<"HTTP/1.1 200\r\n">>, []), ok. http_with_bin(http) -> -- cgit v1.2.3