diff options
author | Sverker Eriksson <sverker@erlang.org> | 2013-02-08 16:24:43 +0100 |
---|---|---|
committer | Sverker Eriksson <sverker@erlang.org> | 2013-02-08 16:24:50 +0100 |
commit | 35e36669a146f0350cd31e4351764c1732ede784 (patch) | |
tree | 1810a875601b3e01616e4eb5f2080a3795321f59 | |
parent | 27d5ba9e31c666bd0a7e278b02df3a5b4ecb8e0b (diff) | |
parent | 92ffb924556e43e3037273754ea94aabc72638a6 (diff) | |
download | otp-35e36669a146f0350cd31e4351764c1732ede784.tar.gz otp-35e36669a146f0350cd31e4351764c1732ede784.tar.bz2 otp-35e36669a146f0350cd31e4351764c1732ede784.zip |
Merge branch 'sverk/packet-http-string-maxlen'
* sverk/packet-http-string-maxlen:
erts: Increase length of well formed header names from {packet,http}
OTP-10824
-rw-r--r-- | erts/doc/src/erlang.xml | 4 | ||||
-rw-r--r-- | erts/emulator/beam/packet_parser.c | 2 | ||||
-rw-r--r-- | erts/emulator/test/decode_packet_SUITE.erl | 3 |
3 files changed, 7 insertions, 2 deletions
diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index b336a135e7..7804a7498e 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -592,7 +592,9 @@ false</pre> request, a response, a header or an end of header mark. Invalid lines are returned as <c><anno>HttpError</anno></c>.</p> <p>Recognized request methods and header fields are returned as atoms. - Others are returned as strings.</p> + Others are returned as strings. Strings of unrecognized header fields + are formatted with only capital letters first and after hyphen characters + (like <c>"Sec-Websocket-Key"</c>).</p> <p>The protocol type <c>http</c> should only be used for the first line when a <c><anno>HttpRequest</anno></c> or a <c><anno>HttpResponse</anno></c> is expected. The following calls diff --git a/erts/emulator/beam/packet_parser.c b/erts/emulator/beam/packet_parser.c index 1e301e3593..7c9b2d444a 100644 --- a/erts/emulator/beam/packet_parser.c +++ b/erts/emulator/beam/packet_parser.c @@ -67,7 +67,7 @@ static int my_strncasecmp(const char *s1, const char *s2, size_t n) #define HTTP_HDR_HASH_SIZE 53 #define HTTP_METH_HASH_SIZE 13 -#define HTTP_MAX_NAME_LEN 20 +#define HTTP_MAX_NAME_LEN 50 static char tspecial[128]; diff --git a/erts/emulator/test/decode_packet_SUITE.erl b/erts/emulator/test/decode_packet_SUITE.erl index 4acbe8c6e0..1714551e15 100644 --- a/erts/emulator/test/decode_packet_SUITE.erl +++ b/erts/emulator/test/decode_packet_SUITE.erl @@ -403,6 +403,9 @@ http_request(Msg) -> {"Other-Field: with some text\r\n", {http_header,0, "Other-Field" ,undefined, "with some text"}, {http_header,0,<<"Other-Field">>,undefined,<<"with some text">>}}, + {"Make-sure-a-LONG-HEaDer-fIeLd-is-fORMATTED-NicelY: with some text\r\n", + {http_header,0, "Make-Sure-A-Long-Header-Field-Is-Formatted-Nicely" ,undefined, "with some text"}, + {http_header,0,<<"Make-Sure-A-Long-Header-Field-Is-Formatted-Nicely">>,undefined,<<"with some text">>}}, {"Multi-Line: Once upon a time in a land far far away,\r\n" " there lived a princess imprisoned in the highest tower\r\n" " of the most haunted castle.\r\n", |