summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-10-08 14:46:29 +0200
committerDaniel Stenberg <daniel@haxx.se>2021-10-08 14:46:29 +0200
commitedc6960648fc4726aa535b33ba88768d68c2d14e (patch)
tree25e01fbfc2a2d4d80b5f508b05444add61e06e0a
parent3a25bd1be8f37eb627b1995871239aded3dd695c (diff)
downloadcurl-bagder/hyper-h2.tar.gz
fixup use the old style for h1...bagder/hyper-h2
As otherwise hyper will use absolute paths (full URLs) in the GET
-rw-r--r--lib/c-hyper.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/lib/c-hyper.c b/lib/c-hyper.c
index 09f832142..81e86c2ad 100644
--- a/lib/c-hyper.c
+++ b/lib/c-hyper.c
@@ -584,17 +584,22 @@ static CURLcode request_target(struct Curl_easy *data,
if(result)
return result;
- if(hyper_request_set_uri_parts(req,
- /* scheme */
- (uint8_t *)data->state.up.scheme,
- strlen(data->state.up.scheme),
- /* authority */
- (uint8_t *)conn->host.name,
- strlen(conn->host.name),
- /* path_and_query */
- (uint8_t *)Curl_dyn_uptr(&r),
- Curl_dyn_len(&r))) {
- failf(data, "error setting path");
+ if(h2 && hyper_request_set_uri_parts(req,
+ /* scheme */
+ (uint8_t *)data->state.up.scheme,
+ strlen(data->state.up.scheme),
+ /* authority */
+ (uint8_t *)conn->host.name,
+ strlen(conn->host.name),
+ /* path_and_query */
+ (uint8_t *)Curl_dyn_uptr(&r),
+ Curl_dyn_len(&r))) {
+ failf(data, "error setting uri parts to hyper");
+ result = CURLE_OUT_OF_MEMORY;
+ }
+ else if(!h2 && hyper_request_set_uri(req, (uint8_t *)Curl_dyn_uptr(&r),
+ Curl_dyn_len(&r))) {
+ failf(data, "error setting uri to hyper");
result = CURLE_OUT_OF_MEMORY;
}
else