From: Michael R Sweet Date: Wed, 18 Oct 2023 16:15:30 +0000 (-0400) Subject: Fix httpAssembleURI to not add the standard port number. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=37e16975aa2384d58d2cbdc50c0de4c88ed1dead;p=thirdparty%2Fcups.git Fix httpAssembleURI to not add the standard port number. --- diff --git a/cups/http-support.c b/cups/http-support.c index b1845efc0f..f28333db0b 100644 --- a/cups/http-support.c +++ b/cups/http-support.c @@ -264,6 +264,13 @@ httpAssembleURI( } // Finish things off with the port number... + if (!strcmp(scheme, "http") && port == 80) + port = 0; + else if (!strcmp(scheme, "https") && port == 443) + port = 0; + else if ((!strcmp(scheme, "ipp") || !strcmp(scheme, "ipps")) && port == 631) + port = 0; + if (port > 0) { snprintf(ptr, (size_t)(end - ptr + 1), ":%d", port);