]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
HTTP2: Add a space character after the status code
authorMichael Kaufmann <mail@michael-kaufmann.ch>
Wed, 6 Apr 2016 12:08:15 +0000 (14:08 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 6 Apr 2016 12:35:08 +0000 (14:35 +0200)
The space character after the status code is mandatory, even if the
reason phrase is empty (see RFC 7230 section 3.1.2)

Closes #755

lib/http2.c

index fd3cefe4b959b5efc68eaed3a25570705c2f6e34..5305eb71e11aee7500565e2306646ff8077a88b5 100644 (file)
@@ -832,7 +832,8 @@ static int on_header(nghttp2_session *session, const nghttp2_frame *frame,
 
     Curl_add_buffer(stream->header_recvbuf, "HTTP/2.0 ", 9);
     Curl_add_buffer(stream->header_recvbuf, value, valuelen);
-    Curl_add_buffer(stream->header_recvbuf, "\r\n", 2);
+    /* the space character after the status code is mandatory */
+    Curl_add_buffer(stream->header_recvbuf, " \r\n", 3);
     data_s->state.drain++;
     /* if we receive data for another handle, wake that up */
     if(conn->data != data_s)