You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "Nakagome Tomoyuki (JIRA)" <ji...@apache.org> on 2014/12/05 09:02:12 UTC

[jira] [Created] (TS-3222) Port number padded with 0 when Host header has explicit port specification

Nakagome Tomoyuki created TS-3222:
-------------------------------------

             Summary: Port number padded with 0 when Host header has explicit port specification
                 Key: TS-3222
                 URL: https://issues.apache.org/jira/browse/TS-3222
             Project: Traffic Server
          Issue Type: Bug
            Reporter: Nakagome Tomoyuki


Due to this line in proxy/hdrs/HTTP.cc:1552

{noformat}
ui->m_len_port = sprintf(port_buff, "%.5d", hdr->m_port);
{noformat}

UrlPrintHack::UrlPrintHack() prepends unnecessary '0's so the port_buff will be 5 chars, like "00080". Suggestion is to remove .5 from the format string and change it to

{noformat}
ui->m_len_port = snprintf(port_buff, 6, "%d", hdr->m_port);
{noformat}

unless there are some specific reasons for the current code.

To replicate the symptom, send a request with a Host header having a port number like:

Host: www.apache.org:80



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)