commit 1db91dc77e5551d8955120674296a29d7820a483 from: Christian Weisgerber date: Sun Apr 28 19:17:51 2024 UTC got-fetch-http: fix GET request URL Add a leading '/' and do not produce a double "//" after the path. ok op commit - ebd4d9a0266bb7a7145bcd6138bf64a5b0c1d004 commit + 1db91dc77e5551d8955120674296a29d7820a483 blob - a62f4f48f936f8cb6c39475cec6af2804c62e233 blob + 81dcd137f8c0c0a0d15ad94c033346ea201d8b95 --- libexec/got-fetch-http/got-fetch-http.c +++ libexec/got-fetch-http/got-fetch-http.c @@ -168,7 +168,7 @@ http_open(struct bufio *bio, int https, const char *me if (ctype) chdr = "Content-Type: "; - r = asprintf(&p, "%s/%s%s%s", path, path_sufx, + r = asprintf(&p, "/%s%s%s%s", path, path_sufx, query ? "?" : "", query ? query : ""); if (r == -1) err(1, "asprintf");