[ 
https://issues.apache.org/jira/browse/TS-1322?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13415936#comment-13415936
 ] 

Yakov Kopel commented on TS-1322:
---------------------------------

yes.
The trailing slash is added in the URL.cc file in the url_print function:
  (line 1551) TRY(mime_mem_print("/", ....
This is done in all the calling of url_print.

The second patch that is done in the HTTP.cc file, remove that slash just after 
calling the url_print function:

         TRY(url_print(hdr->u.req.m_url_impl, buf, bufsize, bufindex, 
dumpoffset));
         if (bufsize - *bufindex >= 1) {
+          if (hdr->u.req.m_method_wks_idx == HTTP_WKSIDX_CONNECT) {
+              *bufindex -= 1; // remove trailing slash for CONNECT request
+          }
                
> CONNECT to parent proxy has URL with a trailing slash
> -----------------------------------------------------
>
>                 Key: TS-1322
>                 URL: https://issues.apache.org/jira/browse/TS-1322
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: HTTP
>            Reporter: Yakov Kopel
>             Fix For: 3.3.0
>
>         Attachments: TS.diff, second.diff
>
>
> I want to redirect a CONNECT request to parent proxy.
> I'm doing it with the TSHttpTxnParentProxySet API.
> The problem is that the URL that the TS is setting is invalid:
>       
>       CONNECT www.example.com:443/ HTTP/1.1
>       Host: www.example.com:443
> The TS adding to every URL a trailing slash in the end of the URL, but here 
> it makes the URL invalid (look at http://www.ietf.org/rfc/rfc2817.txt  in 
> section 5.2).
> Solution:
>       I'm suggesting a patch for the URL.cc file that doesn't add a trailing 
> slash when not needed (when there is only hostname).
>       This is valid action as is written in the RFC 
> (http://tools.ietf.org/html/rfc3986 in section 3) :
>               "When authority is present, the path must either be empty -or- 
> begin with a slash ("/") character"
>       While" authority" is the hostaname.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to