]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
HTTP3/quiche: terminate h1 response header when no body is sent
authorStefan Eissing <stefan@eissing.org>
Thu, 20 Apr 2023 09:59:52 +0000 (11:59 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 24 Apr 2023 11:40:47 +0000 (13:40 +0200)
- fixes a failure in test2501 where a response without body was missing
  the final empty line

Closes #11003

lib/vquic/curl_quiche.c

index 6f2736d66e5ecfff846884fbb8d5617f4bd95de7..1a6838b0127f8b649c059373f3745d6f237f7fe1 100644 (file)
@@ -527,6 +527,12 @@ static CURLcode h3_process_event(struct Curl_cfilter *cf,
 
   case QUICHE_H3_EVENT_FINISHED:
     DEBUGF(LOG_CF(data, cf, "[h3sid=%"PRId64"][FINISHED]", stream3_id));
+    if(!stream->resp_hds_complete) {
+      result = write_resp_raw(cf, data, "\r\n", 2);
+      if(result)
+        return result;
+      stream->resp_hds_complete = TRUE;
+    }
     stream->closed = TRUE;
     streamclose(cf->conn, "End of stream");
     break;