Skip to content

Commit 19efd8c

Browse files
committed
Fixed HTTP headers parsing for async_server
Ported commit 20fded1
1 parent 30dac6f commit 19efd8c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

boost/network/protocol/http/server/async_connection.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@ namespace boost { namespace network { namespace http {
402402
request_.http_version_major = fusion::get<0>(version_pair);
403403
request_.http_version_minor = fusion::get<1>(version_pair);
404404
new_start = boost::end(result_range);
405+
partial_parsed.clear();
405406
} else {
406407
partial_parsed.append(
407408
boost::begin(result_range),
@@ -423,7 +424,6 @@ namespace boost { namespace network { namespace http {
423424
partial_parsed.append(
424425
boost::begin(result_range),
425426
boost::end(result_range));
426-
trim(partial_parsed);
427427
parse_headers(partial_parsed, request_.headers);
428428
new_start = boost::end(result_range);
429429
thread_pool().post(

libs/network/src/server_request_parsers_impl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ namespace boost { namespace network { namespace http {
3131
*(
3232
+(alnum|(punct-':'))
3333
>> lit(": ")
34-
>> +(alnum|space|punct)
34+
>> +((alnum|space|punct) - '\r' - '\n')
3535
>> lit("\r\n")
3636
)
37+
>> lit("\r\n")
3738
, container
3839
);
3940
}

0 commit comments

Comments
 (0)