Skip to content

Commit 20fded1

Browse files
committed
Fixed HTTP headers parsing for async_server
1 parent a155444 commit 20fded1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@ namespace boost { namespace network { namespace http {
388388
request_.http_version_major = fusion::get<0>(version_pair);
389389
request_.http_version_minor = fusion::get<1>(version_pair);
390390
new_start = boost::end(result_range);
391+
partial_parsed.clear();
391392
} else {
392393
partial_parsed.append(
393394
boost::begin(result_range),
@@ -409,7 +410,6 @@ namespace boost { namespace network { namespace http {
409410
partial_parsed.append(
410411
boost::begin(result_range),
411412
boost::end(result_range));
412-
trim(partial_parsed);
413413
parse_headers(partial_parsed, request_.headers);
414414
new_start = boost::end(result_range);
415415
thread_pool().post(
@@ -479,9 +479,10 @@ namespace boost { namespace network { namespace http {
479479
*(
480480
+(alnum|(punct-':'))
481481
>> lit(": ")
482-
>> +(alnum|space|punct)
482+
>> +((alnum|space|punct) - '\r' - '\n')
483483
>> lit("\r\n")
484484
)
485+
>> lit("\r\n")
485486
, container
486487
);
487488
}

0 commit comments

Comments
 (0)