[
https://issues.apache.org/jira/browse/TS-2344?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14000683#comment-14000683
]
Ethan Lai edited comment on TS-2344 at 5/20/14 2:15 PM:
--------------------------------------------------------
[~zwoop] This remap_redirect URL is used inside of build_error_response(),
which set correct Location header for building response body with
"%<{Location}psh>" field.
If this Location header is set after calling build_error_response(), response
body will have empty "%<{Location}psh>" field because it was already generated.
{code}
+ if ((status_code == HTTP_STATUS_TEMPORARY_REDIRECT ||
+ status_code == HTTP_STATUS_MOVED_TEMPORARILY ||
+ status_code == HTTP_STATUS_MOVED_PERMANENTLY) &&
+ s->remap_redirect) {
+ s->hdr_info.client_response.value_set(MIME_FIELD_LOCATION,
MIME_LEN_LOCATION, s->remap_redirect, strlen(s->remap_redirect));
+ }
{code}
Current redirect_temporary response body (Please notice the empty Location):
{code}
HTTP/1.1 307 Redirect
Date: Sat, 17 May 2014 05:55:21 GMT
Server: ATS
Cache-Control: no-store
Content-Type: text/html; charset=utf-8
Content-Language: en
Connection: close
Location: https://www.example.com/
Content-Length: 283
<HTML>
<HEAD>
<TITLE>Document Has Moved</TITLE>
</HEAD>
<BODY BGCOLOR="white" FGCOLOR="black">
<H1>Document Has Moved</H1>
<HR>
<FONT FACE="Helvetica,Arial"><B>
Description: The document you requested has moved to a new location. The new
location is "-".
</B></FONT>
<HR>
</BODY>
{code}
I'm not that familiar with passing additional parameter, remap_redirect_len
here, while calling build_error_response().
Please feel free to enhance this patch. :)
was (Author: yzlai):
The remap_redirect URL is used inside of build_error_response(), which set
correct Location header for building response body with "%<{Location}psh>"
field.
If this Location header is set after calling build_error_response(), response
body will have empty "%<{Location}psh>" field because it was already generated.
{code}
+ if ((status_code == HTTP_STATUS_TEMPORARY_REDIRECT ||
+ status_code == HTTP_STATUS_MOVED_TEMPORARILY ||
+ status_code == HTTP_STATUS_MOVED_PERMANENTLY) &&
+ s->remap_redirect) {
+ s->hdr_info.client_response.value_set(MIME_FIELD_LOCATION,
MIME_LEN_LOCATION, s->remap_redirect, strlen(s->remap_redirect));
+ }
{code}
Current redirect_temporary response body (Please notice the empty Location):
{code}
HTTP/1.1 307 Redirect
Date: Sat, 17 May 2014 05:55:21 GMT
Server: ATS
Cache-Control: no-store
Content-Type: text/html; charset=utf-8
Content-Language: en
Connection: close
Location: https://www.example.com/
Content-Length: 283
<HTML>
<HEAD>
<TITLE>Document Has Moved</TITLE>
</HEAD>
<BODY BGCOLOR="white" FGCOLOR="black">
<H1>Document Has Moved</H1>
<HR>
<FONT FACE="Helvetica,Arial"><B>
Description: The document you requested has moved to a new location. The new
location is "-".
</B></FONT>
<HR>
</BODY>
{code}
I'm not that familiar with passing additional parameter, remap_redirect_len
here, while calling build_error_response().
Please feel free to enhance this patch. :)
> 404 error was logged while url redirect request was processed corrctly
> ----------------------------------------------------------------------
>
> Key: TS-2344
> URL: https://issues.apache.org/jira/browse/TS-2344
> Project: Traffic Server
> Issue Type: Bug
> Components: Logging
> Reporter: Eddie
> Assignee: Bryan Call
> Labels: Review
> Fix For: 5.0.0
>
> Attachments: no_redirect_after_map.patch
>
>
> I am seeing a lot of entries in the error log for my url redirect request.
> The request was processed correctly and I could see the expected response in
> log as below:
> 2013-11-08 18:23:37 <IP> 301 FIN http://yahoo.com
> http://www.yahoo.com/
> But log messages like following were printed in the error log too, which
> generates a lot of error logs (log rotation configured) and filling up disk
> space pretty fast.
> 20131108.18h23m37s RESPONSE: sent <IP> status 404 (Not Found on
> Accelerator) for 'http:///'
> 20131108.18h23m37s RESPONSE: sent <IP> status 301 (Redirect)
> for 'http:///'
> I watched my tcpdump log and did not see that the 404 error was sent out at
> all. I am using ATS/3.2.4 (also checked with I am seeing a lot of entries in
> the error log for my url redirect request. The request was processed correctly
> I could see the expected response in log as well:
> 2013-11-08 18:23:37 <IP> 301 FIN http://yahoo.com
> http://www.yahoo.com/
> But log messages like following were printed too:
> 20131108.18h23m37s RESPONSE: sent <IP> status 404 (Not Found on
> Accelerator) for 'http:///'
> 20131108.18h23m37s RESPONSE: sent <IP> status 301 (Redirect)
> for 'http:///'
> I watched my tcpdump log and did not see that the 404 error was sent out at
> all. I am using ATS/3.2.4 and following
> is the log configuration.
> CONFIG proxy.config.log.logging_enabled INT 3
> CONFIG proxy.config.log.max_secs_per_buffer INT 1
> CONFIG proxy.config.log.max_space_mb_for_logs INT 25000
> CONFIG proxy.config.log.max_space_mb_for_orphan_logs INT 25
> CONFIG proxy.config.log.max_space_mb_headroom INT 1000
> CONFIG proxy.config.log.hostname STRING localhost
> CONFIG proxy.config.log.logfile_dir STRING var/log/trafficserver
> CONFIG proxy.config.log.logfile_perm STRING rw-r--r--
> CONFIG proxy.config.log.custom_logs_enabled INT 1
> CONFIG proxy.config.log.squid_log_enabled INT 0
> CONFIG proxy.config.log.squid_log_is_ascii INT 0
> CONFIG proxy.config.log.squid_log_name STRING squid
> CONFIG proxy.config.log.squid_log_header STRING NULL
> CONFIG proxy.config.log.common_log_enabled INT 0
> CONFIG proxy.config.log.common_log_is_ascii INT 1
> CONFIG proxy.config.log.common_log_name STRING common
> CONFIG proxy.config.log.common_log_header STRING NULL
> CONFIG proxy.config.log.extended_log_enabled INT 0
> CONFIG proxy.config.log.extended_log_is_ascii INT 0
> CONFIG proxy.config.log.extended_log_name STRING extended
> CONFIG proxy.config.log.extended_log_header STRING NULL
> CONFIG proxy.config.log.extended2_log_enabled INT 0
> CONFIG proxy.config.log.extended2_log_is_ascii INT 1
> CONFIG proxy.config.log.extended2_log_name STRING extended2
> CONFIG proxy.config.log.extended2_log_header STRING NULL
> CONFIG proxy.config.log.separate_icp_logs INT 0
> CONFIG proxy.config.log.separate_host_logs INT 0
> Is this a bug or is this a misconfiguration? Does anyone have any idea?) and
> following is the log configuration.
> CONFIG proxy.config.log.logging_enabled INT 3
> CONFIG proxy.config.log.max_secs_per_buffer INT 1
> CONFIG proxy.config.log.max_space_mb_for_logs INT 25000
> CONFIG proxy.config.log.max_space_mb_for_orphan_logs INT 25
> CONFIG proxy.config.log.max_space_mb_headroom INT 1000
> CONFIG proxy.config.log.hostname STRING localhost
> CONFIG proxy.config.log.logfile_dir STRING var/log/trafficserver
> CONFIG proxy.config.log.logfile_perm STRING rw-r--r--
> CONFIG proxy.config.log.custom_logs_enabled INT 1
> CONFIG proxy.config.log.squid_log_enabled INT 0
> CONFIG proxy.config.log.squid_log_is_ascii INT 0
> CONFIG proxy.config.log.squid_log_name STRING squid
> CONFIG proxy.config.log.squid_log_header STRING NULL
> CONFIG proxy.config.log.common_log_enabled INT 0
> CONFIG proxy.config.log.common_log_is_ascii INT 1
> CONFIG proxy.config.log.common_log_name STRING common
> CONFIG proxy.config.log.common_log_header STRING NULL
> CONFIG proxy.config.log.extended_log_enabled INT 0
> CONFIG proxy.config.log.extended_log_is_ascii INT 0
> CONFIG proxy.config.log.extended_log_name STRING extended
> CONFIG proxy.config.log.extended_log_header STRING NULL
> CONFIG proxy.config.log.extended2_log_enabled INT 0
> CONFIG proxy.config.log.extended2_log_is_ascii INT 1
> CONFIG proxy.config.log.extended2_log_name STRING extended2
> CONFIG proxy.config.log.extended2_log_header STRING NULL
> CONFIG proxy.config.log.separate_icp_logs INT 0
> CONFIG proxy.config.log.separate_host_logs INT 0
> Is this a bug or is this a misconfiguration? Does anyone have any idea?
> Also, I noticed that with ATS/4.0.1, if there is no URL redirect rule defined
> in remap.config, I will not see the following response back as ATS 3.2.4:
> HTTP/1.1 404 Not Found on Accelerator
> Date: Wed, 13 Nov 2013 14:18:19 GMT
> Connection: close
> Server: ATS/3.2.4
> Cache-Control: no-store
> Content-Type: text/html
> Content-Language: en
> Content-Length: 240
> Is this intentional?
--
This message was sent by Atlassian JIRA
(v6.2#6252)