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

Alan M. Carroll edited comment on TS-3469 at 3/30/15 3:10 PM:
--------------------------------------------------------------

Based on experiments I've done if you have redirection enabled then 
READ_RESPONSE_HDR_HOOK can be called multiple times in a transaction. Once for 
the initial (301) response and then again for the subsequent (200) response (or 
more, if you bounce around for a while). Set the following values in 
{{records.config}}

{code}
proxy.config.http.redirection_enabled INT 1
proxy.config.http.number_of_redirections INT 3
{code}

One way to see this is to set up an HTTP server with some files and add the 
following configuration line

{code}
RedirectMatch 301 redirect-(.*) http://fqdn.com/$1
{code}

where {{fqdn.com}} is the name of your webserver. This means that if 
{{http://fqdn.com/bob.html}} is a valid URL, so is 
{{http://fqdn.com/redirect-bob.html}} which will return a 301 redirect to 
bob.html. You can test this with curl as well as
{code}
curl --location http://fqdn.com/redirect-bob.html
{code}



was (Author: amc):
Based on experiments I've done if you have redirection enabled then 
READ_RESPONSE_HDR_HOOK can be called multiple times in a transaction. Once for 
the initial (301) response and then again for the subsequent (200) response (or 
more, if you bounce around for a while). Set the following values in 
{{records.config}}

{code}
proxy.config.http.redirection_enabled INT 1
proxy.config.http.number_of_redirections INT 3
{code}

One way to see this is to set up an HTTP server with some files and add the 
following configuration line

{code}
RedirectMatch 301 redirect-(.*) http://fqdn.com/$1
{code}

where {{fqdn.com}} is the name of your webserver. This means that if 
{{http://fqdn.com/bob.html}} is a valid URL, so is 
{{http://fqdn.com/redirect-bob.html}} which will return a 301 redirect to 
bob.html. You can test this with curl as well as

curl --location http://fqdn.com/redirect-bob.html



> Update plugin docs to reflect multiple calls to SEND_RESPONSE_HDR
> -----------------------------------------------------------------
>
>                 Key: TS-3469
>                 URL: https://issues.apache.org/jira/browse/TS-3469
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Documentation
>            Reporter: Scott Beardsley
>            Assignee: Alan M. Carroll
>             Fix For: sometime
>
>
> We ran into a problem where SEND_RESPONSE_HDR was being called multiple times 
> leading to a crash. The docs are unclear on this point so we should update 
> them to reflect this intermittent case.



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

Reply via email to