Uploaded image for project: 'Traffic Server'
  1. Traffic Server
  2. TS-2320

TSRedirectUrlSet truncates host header in redirected request

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.2.5, 4.0.2
    • 4.1.2
    • HTTP
    • None

    Description

      The TSRedirectUrlSet(TSHttpTxn txnp, const char* url, const int url_len) function truncates the host header when making the OS request to the redirected URL.

      Currently the experimental plugin custom_redirect appears to be the only user of this function. Debug output from traffic.out show the intended redirect target as 'http://localhost/test.php?size=100&cache=30' but the HOST header is truncated to 'localhos':

      +++++++++ Proxy's Response 2 +++++++++
      – State Machine Id: 1
      HTTP/1.1 200 OK
      Date: Tue, 05 Nov 2013 19:11:39 GMT
      P3P: policyref="http://info.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV"
      x-redirect-url: http://localhost/test.php?size=100&cache=30
      Cache-Control: private
      Content-Length: 534
      Content-Type: text/html; charset=UTF-8
      Age: 0
      Connection: keep-alive
      Server: ATS/4.0.1

      [Nov 5 13:11:39.449] Server

      {0x2b12f8f0e700} DEBUG: (http_redirect) [HttpSM::do_redirect]
      [Nov 5 13:11:39.449] Server {0x2b12f8f0e700}

      DEBUG: (http_redirect) [HttpSM::redirect_request]
      +++++++++ Framed Client Request..checking +++++++++
      – State Machine Id: 1
      GET http://localhost/test.php?size=100&cache=30 HTTP/1.1
      User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.13.1.0 zlib/1.2.3 libidn/1.18 libssh2/1.2.2
      Accept: /
      Host: localhos+++++++++ Incoming Request +++++++++
      – State Machine Id: 1
      GET http://localhost/test.php?size=100&cache=30 HTTP/1.1
      User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.13.1.0 zlib/1.2.3 libidn/1.18 libssh2/1.2.2
      Accept: /
      Host: localhos+++++++++ Proxy's Request +++++++++

      Attachments

        1. ts2320.diff
          0.6 kB
          Ron Barber

        Activity

          People

            bcall Bryan Call
            rwbarber2 Ron Barber
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: