You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2015/07/15 23:09:05 UTC

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

    [ https://issues.apache.org/jira/browse/TS-3740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14628736#comment-14628736 ] 

ASF GitHub Bot commented on TS-3740:
------------------------------------

GitHub user gtenev opened a pull request:

    https://github.com/apache/trafficserver/pull/253

    TS-3740: header_rewrite set-redirect enhancement.

    header_rewrite set-redirect support when not called from remap plugin.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/gtenev/trafficserver ts3740

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/trafficserver/pull/253.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #253
    
----
commit c333b7b9d2eae6e92b3fd8c2e7988e3ac48e1c26
Author: Gancho Tenev <gt...@gmail.com>
Date:   2015-07-15T21:04:52Z

    TS-3740: header_rewrite set-redirect enhancement.
    
    header_rewrite set-redirect support when not called from remap plugin.

----


> 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
>            Assignee: Gancho Tenev
>             Fix For: 6.1.0
>
>
> 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)