[ https://issues.apache.org/jira/browse/TS-2930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14060038#comment-14060038 ]
ASF subversion and git services commented on TS-2930: ----------------------------------------------------- Commit ad8534ec3647e0a0732ef13314a4c81c6b12871f in trafficserver's branch refs/heads/master from [~kichan] [ https://git-wip-us.apache.org/repos/asf?p=trafficserver.git;h=ad8534e ] TS-2930: missing hostname in ts.client_request.get_url() in lua plugin > Missing hostname in ts.client_request.get_url() > ----------------------------------------------- > > Key: TS-2930 > URL: https://issues.apache.org/jira/browse/TS-2930 > Project: Traffic Server > Issue Type: Bug > Components: Lua, Plugins, TS API > Affects Versions: 5.0.0 > Reporter: Nikolai Gorchilov > Assignee: Kit Chan > Fix For: 5.1.0 > > > In Linux TPROXY forwarding mode ts.client_request.get_uri() omits hostname > from the returned url - responds with "http:///pathname?parameters" instead > of "http://hostname/pathname?parameters". This happens in the context of > early state hooks up to and including TS_HTTP_POST_REMAP_HOOK. > In case of cacheurl.so rewrite on the URL, hostname reamains empty even after > post_remap. > Here're the steps to reproduce the problem - a global lua plugin > (plugins.config): > ==========[cut]========== > function do_global_txn_start() > print('==========[cut]==========') > print ('do_global_txt_start: ' .. ts.client_request.get_url()) > end > function do_global_txn_close() > print ('do_global_txn_close: ' .. ts.client_request.get_url()) > print('==========[cut]==========') > end > function do_global_os_dns() > print ('do_global_os_dns: ' .. ts.client_request.get_url()) > end > function do_global_pre_remap() > print ('do_global_pre_remap: ' .. ts.client_request.get_url()) > end > function do_global_post_remap() > print ('do_global_post_remap: ' .. ts.client_request.get_url()) > end > function do_global_read_request() > print ('do_global_read_request: ' .. ts.client_request.get_url()) > end > function do_global_send_request() > print ('do_global_send_request: ' .. ts.client_request.get_url()) > end > function do_global_read_response() > print ('do_global_read_response: ' .. ts.client_request.get_url()) > end > function do_global_send_response() > print ('do_global_send_response: ' .. ts.client_request.get_url()) > end > function do_global_cache_lookup_complete() > print ('do_global_cache_lookup_complete: ' .. > ts.client_request.get_url()) > end > function do_global_read_cache() > print ('do_global_read_cache: ' .. ts.client_request.get_url()) > end > Requesting same URL - > http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png - in 4 > different scenarios: > 1. empty cache (MISS) without cacheurl.so activated > 2. HIT request without cacheurl.so activated > 3. empty cache (MISS) with cacheurl.so activated > 4. HIT request with cacheurl.so activated > cacheurl.config consists the following: > ^http://[^\/]*(yimg\.com)/(.*) http://$1.internal/$2 > Here's my traffic.out output: > 1. MISS without cacheurl.so > ==========[cut]========== > do_global_txt_start: / > do_global_read_request: > http:///os/mit/media/m/base/images/transparent-1093278.png > do_global_pre_remap: > http:///os/mit/media/m/base/images/transparent-1093278.png > do_global_post_remap: > http:///os/mit/media/m/base/images/transparent-1093278.png > do_global_os_dns: > http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png > do_global_cache_lookup_complete: > http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png > do_global_send_request: > http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png > do_global_read_response: > http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png > do_global_send_response: > http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png > do_global_txn_close: > http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png > ==========[cut]========== > 2. HIT without cacheurl.so: > ==========[cut]========== > do_global_txt_start: / > do_global_read_request: > http:///os/mit/media/m/base/images/transparent-1093278.png > do_global_pre_remap: > http:///os/mit/media/m/base/images/transparent-1093278.png > do_global_post_remap: > http:///os/mit/media/m/base/images/transparent-1093278.png > do_global_read_cache: > http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png > do_global_cache_lookup_complete: > http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png > do_global_send_response: > http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png > do_global_txn_close: > http://l.yimg.com/os/mit/media/m/base/images/transparent-1093278.png > ==========[cut]========== > 3. MISS with cacheurl.so: > ==========[cut]========== > do_global_txt_start: / > do_global_read_request: > http:///os/mit/media/m/base/images/transparent-1093278.png > do_global_pre_remap: > http:///os/mit/media/m/base/images/transparent-1093278.png > do_global_post_remap: > http:///os/mit/media/m/base/images/transparent-1093278.png > do_global_cache_lookup_complete: > http:///os/mit/media/m/base/images/transparent-1093278.png > do_global_os_dns: http:///os/mit/media/m/base/images/transparent-1093278.png > do_global_send_request: > http:///os/mit/media/m/base/images/transparent-1093278.png > do_global_read_response: > http:///os/mit/media/m/base/images/transparent-1093278.png > do_global_send_response: > http:///os/mit/media/m/base/images/transparent-1093278.png > do_global_txn_close: > http:///os/mit/media/m/base/images/transparent-1093278.png > ==========[cut]========== > 4. HIT with cacheurl.so: > ==========[cut]========== > do_global_txt_start: / > do_global_read_request: > http:///os/mit/media/m/base/images/transparent-1093278.png > do_global_pre_remap: > http:///os/mit/media/m/base/images/transparent-1093278.png > do_global_post_remap: > http:///os/mit/media/m/base/images/transparent-1093278.png > do_global_read_cache: > http:///os/mit/media/m/base/images/transparent-1093278.png > do_global_cache_lookup_complete: > http:///os/mit/media/m/base/images/transparent-1093278.png > do_global_send_response: > http:///os/mit/media/m/base/images/transparent-1093278.png > do_global_txn_close: > http:///os/mit/media/m/base/images/transparent-1093278.png > ==========[cut]========== -- This message was sent by Atlassian JIRA (v6.2#6252)