commit 238afc7478136a053d90a8bfe4404b84be65714b from: Omar Polo date: Thu Apr 01 07:50:05 2021 UTC correctly handle the port in the request add an explicit port if one is given and it's not 1965 commit - 1c55b953512e802e518f22049ddd3891e702d541 commit + 238afc7478136a053d90a8bfe4404b84be65714b blob - 083029d40c9a5c726d18dc63e3feacee6200b342 blob + 15e1d100b7d8c226a577e0f08d39cb041580c777 --- gemini.c +++ gemini.c @@ -390,6 +390,10 @@ write_request(int fd, short ev, void *d) strlcpy(buf, "gemini://", sizeof(buf)); strlcat(buf, req->url.host, sizeof(buf)); + if (*req->url.port != '\0' && strcmp("1965", req->url.port)) { + strlcat(buf, ":", sizeof(buf)); + strlcat(buf, req->url.port, sizeof(buf)); + } strlcat(buf, "/", sizeof(buf)); strlcat(buf, req->url.path, sizeof(buf));