You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "Gancho Tenev (JIRA)" <ji...@apache.org> on 2015/07/06 19:10:04 UTC

[jira] [Created] (TS-3740) header_rewrite plugin: set-redirect doesn't work with SEND_RESPONSE_HDR_HOOK

Gancho Tenev created TS-3740:
--------------------------------

             Summary: header_rewrite plugin: set-redirect doesn't work with SEND_RESPONSE_HDR_HOOK
                 Key: TS-3740
                 URL: https://issues.apache.org/jira/browse/TS-3740
             Project: Traffic Server
          Issue Type: Bug
          Components: Plugins
            Reporter: Gancho Tenev


DESCRIPTION:

ATS header_rewrite plugin set-redirect operation doesn't work with SEND_RESPONSE_HDR_HOOK. Please see the debugging notes below for more info.


HOW TO REPRODUCE:

Here is a sample plugin configuration files that reproduce the problem

$ cat /opt/ats/etc/trafficserver/remap.config
map http://p1 http://h1:8001 \
    @plugin=header_rewrite.so @pparam=/opt/ats/etc/trafficserver/header_rewrite.config

$ cat /opt/ats/etc/trafficserver/header_rewrite.config
cond %{SEND_RESPONSE_HDR_HOOK}
cond %{STATUS} =502
set-redirect 302 http://p0/%{PATH} [QSA]


DEBUGGING NOTES:

Both conditions in the header_rewrite.config are evaluated correctly but set-redirect has no effect and the response to the UA is not modified as expected.  After some debugging it turned out that if the set-redirect (OperatorSetDestination::exec) is not called from the remap plugin it has no effect. The header_rewrite plugin creates a continuation to be called from SEND_RESPONSE_HDR_HOOK (TSHttpHookAdd()). OperatorSetDestination::exec doesn't have code to handle the case when the set-redirect operation is _not_ called directly from the remap plugin (TSRemapDoRemap()).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)