]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
hyper: fix test 357
authorGarrett Squire <github@garrettsquire.com>
Sat, 7 May 2022 00:34:14 +0000 (17:34 -0700)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 8 May 2022 21:19:05 +0000 (23:19 +0200)
This change fixes the hyper API such that PUT requests that receive a
417 response can retry without the Expect header.

Closes #8811

lib/c-hyper.c
tests/data/DISABLED

index de09568741c983e36673a6cec85bbbd9c1c31c0b..69082982cfc5c843a078af05c836eaf44232a24c 100644 (file)
@@ -439,6 +439,13 @@ CURLcode Curl_hyper_stream(struct Curl_easy *data,
     reasonp = hyper_response_reason_phrase(resp);
     reason_len = hyper_response_reason_phrase_len(resp);
 
+    if(http_status == 417 && data->state.expect100header) {
+      infof(data, "Got 417 while waiting for a 100");
+      data->state.disableexpect = TRUE;
+      data->req.newurl = strdup(data->state.url);
+      Curl_done_sending(data, k);
+    }
+
     result = status_line(data, conn,
                          http_status, http_version, reasonp, reason_len);
     if(result)
@@ -951,6 +958,11 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done)
       goto error;
     }
   }
+  else {
+    if(!h2 && !data->state.disableexpect) {
+      data->state.expect100header = TRUE;
+    }
+  }
 
   if(hyper_request_set_method(req, (uint8_t *)method, strlen(method))) {
     failf(data, "error setting method");
index 453a0ecebee2a875562d9866980df0a45e64ff1f..fe06367b4db086e594945d06c7d2c2371f639ddf 100644 (file)
@@ -42,7 +42,6 @@
 %if hyper
 265
 266
-357
 565
 579
 587