Skip to content

Commit

Permalink
Fix httpAssembleURI to not add the standard port number.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelrsweet committed Oct 18, 2023
1 parent 5718e10 commit 37e1697
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cups/http-support.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 37e1697

Please sign in to comment.