File tree Expand file tree Collapse file tree
libs/server-sent-events/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -428,20 +428,11 @@ size_t CurlClient::HeaderCallback(char const* buffer,
428428 auto * context = static_cast <RequestContext*>(userdata);
429429
430430 std::string_view line (buffer, total_size);
431- if (line.size () >= 2 && line[line.size () - 2 ] == ' \r ' &&
432- line.back () == ' \n ' ) {
433- line.remove_suffix (2 );
434- }
435431
436- if (line.empty ()) {
437- // End-of-headers terminator: emit and reset.
438- context->response (std::move (context->current_response ));
439- context->current_response = http::response_header<>{};
440432 // Strip the line terminator. Allow bare LF or bare CR per RFC 9112 §2.2;
441433 // libcurl preserves the original wire bytes for HTTP/1.x (only HTTP/2
442434 // synthesizes CRLF), so a non-compliant origin can deliver bare LF here.
443- while (!line.empty () &&
444- (line.back () == ' \r ' || line.back () == ' \n ' )) {
435+ while (!line.empty () && (line.back () == ' \r ' || line.back () == ' \n ' )) {
445436 line.remove_suffix (1 );
446437 }
447438
You can’t perform that action at this time.
0 commit comments