From 37e16975aa2384d58d2cbdc50c0de4c88ed1dead Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Wed, 18 Oct 2023 12:15:30 -0400 Subject: [PATCH] Fix httpAssembleURI to not add the standard port number. --- cups/http-support.c | 7 +++++++ 1 file changed, 7 insertions(+) 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); -- 2.47.2