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

Adding/creating new lua APIs: "ts.server_request.set_url_host", "ts.server_request.get_url_host", "ts.server_request.set_url_scheme", and "ts.server_request.get_url_scheme "

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 6.2.1, 7.0.0
    • Lua
    • None

    Description

      Create new lua APIs "ts.server_request.set_url_host", "ts.server_request.get_url_host", "ts.server_request.set_url_scheme", and "ts.server_request.get_url_scheme " to Set/Get scheme and host name in the server request to next tier.

      These APIs are useful to remove scheme and host name in the request to parent, which help to have a parent remap.config entry similar to child cache. This makes provisioning more meaningful and easy at both parent and child.

      With this fix, the GET request to parent will change..

      from:

      +++++++++ Proxy's Request +++++++++
      – State Machine Id: 5593
      GET http://origin.com/dir1/a.txt HTTP/1.1^M
      User-Agent: curl/7.29.0^M
      Host: abc.com^M
      Accept: /^M
      Client-ip: 135.xx.xx.xx^M
      X-Forwarded-For: 135.xx.xx.xx^M

      To:
      +++++++++ Proxy's Request +++++++++
      – State Machine Id: 5593
      GET /dir1/a.txt HTTP/1.1^M
      User-Agent: curl/7.29.0^M
      Host: abc.com^M
      Accept: /^M
      Client-ip: 135.xx.xx.xx^M
      X-Forwarded-For: 135.xx.xx.xx^M

      This will enable to have parent and child's remap.config entries as below:

      map http://abc.com http://origin.com @plugin=tslua.so @pparam=/opt/trafficserver/etc/trafficserver/lua/test.lua

      Attachments

        Activity

          People

            Unassigned Unassigned
            rkishore Rajendra Kishore Bonumahanti
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 6h 50m
                6h 50m