> On Aug 19, 2016, at 8:09 AM, Shu Kit Chan <chanshu...@gmail.com> wrote: > > Or another way to put it - can we achieve this with existing C APIs?
Although efficient APIs to convert requests between absolute and relative forms could be useful. I have a plugin that manipulates the outgoing request and ends up with an absolute URL; I wouldn't mind being able to easily convert that back to relative form. > If yes, then we can put that in a lua API. > > Thanks. > > Kit > > On Fri, Aug 19, 2016 at 8:07 AM, James Peach <jpe...@apache.org> wrote: >> >>> On Aug 15, 2016, at 10:50 AM, BONUMAHANTI, RAJENDRA KISHORE >>> <rb3...@att.com> wrote: >>> >>> Hi, >>> >>> I have added a new API "TSUrlRemoveHostName()" to InkAPI.cc to remove host >>> name from the GET send to next tier. Refer TS-4724 & PR-859 for more >>> information. >>> >>> Create a new lua API "ts.server_request.remove_host_name_from_url()" to >>> remove host name from the GET request to next tier. This helps to have a >>> parent remap.config entry similar to child cache. This makes provisioning >>> more meaningful and easy at both parent and child. >> >> Can this be done using the existing Lua APIs? What's the tradeoff between >> doing that vs. adding more C APIs? >> >>> >>> 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://abc.com/> http://origin.com<http://origin.com/> >>> @plugin=tslua.so @pparam=/opt/trafficserver/etc/trafficserver/lua/test.lua >>> Please provide your comments. >>> >>> Regards, >>> Kishore >>