Return-Path: X-Original-To: apmail-trafficserver-users-archive@www.apache.org Delivered-To: apmail-trafficserver-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EFE0D10727 for ; Sat, 23 Nov 2013 07:40:57 +0000 (UTC) Received: (qmail 11497 invoked by uid 500); 23 Nov 2013 07:40:56 -0000 Delivered-To: apmail-trafficserver-users-archive@trafficserver.apache.org Received: (qmail 11152 invoked by uid 500); 23 Nov 2013 07:40:56 -0000 Mailing-List: contact users-help@trafficserver.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@trafficserver.apache.org Delivered-To: mailing list users@trafficserver.apache.org Received: (qmail 11144 invoked by uid 99); 23 Nov 2013 07:40:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 23 Nov 2013 07:40:55 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of moseleymark@gmail.com designates 209.85.223.182 as permitted sender) Received: from [209.85.223.182] (HELO mail-ie0-f182.google.com) (209.85.223.182) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 23 Nov 2013 07:40:50 +0000 Received: by mail-ie0-f182.google.com with SMTP id as1so3690964iec.41 for ; Fri, 22 Nov 2013 23:40:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=LFkEuf1YUQtxIMKGNmCDVWdQGIQUvGX5QiA7fm+Nb30=; b=vxsZJHn70SUmwXPgapR/Pl+77OGKwsTANMg9lCoHm3oqH64ADhxT8VxPjXfUFl0sYa nt+VD98LJR7jOtEHB38G9UR4SO+4GVriaolpSHALj8Wuu0F+2QktvS2cSzYvl3Bye+LA vWZy4wm5U1lBFWkh+koXOw3BDeYxgpUJPivCSZdo01kfYDnrFfuDKV3iESdBR6McwO59 urhasBdhPGLqLMdxTJjPHjStNqWOqIJ8U4RY0m08SzP9ENxQ1OO/+bX0jOJqrvHmrwPq eN03bqFOKgXzla8Od5vm6ORmXAMWpvQX8ndtjAlWnst5Gol1GYTtnog+oGFTX8u/3/jQ ylQg== MIME-Version: 1.0 X-Received: by 10.42.250.148 with SMTP id mo20mr10388397icb.34.1385192429814; Fri, 22 Nov 2013 23:40:29 -0800 (PST) Received: by 10.50.102.10 with HTTP; Fri, 22 Nov 2013 23:40:29 -0800 (PST) In-Reply-To: References: Date: Fri, 22 Nov 2013 23:40:29 -0800 Message-ID: Subject: Re: Adding headers to 304 Responses From: Mark Moseley To: users@trafficserver.apache.org Content-Type: multipart/alternative; boundary=20cf300e4e51b989e404ebd33e02 X-Virus-Checked: Checked by ClamAV on apache.org --20cf300e4e51b989e404ebd33e02 Content-Type: text/plain; charset=ISO-8859-1 On Fri, Nov 22, 2013 at 7:24 PM, Shu Kit Chan wrote: > I think the problem is not with the plugin. The debug log is telling us > that, i think. > We can add a static header to the 304 response with no problem. > > The situation is that - > > 1) There is a custom header (X-From-Apache) in the original response from > origin server. > 2) This response is cached in ATS > 3) When client uses IMS in the request, ATS responds with a 304. > 4) The custom header is nowhere to be found in the 304 respond > 5) And thus the header_rewrite plugin cannot get its value. > > I think ATS is doing the right thing for 304 as mentioned here - > http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5 > So how do we override this behavior and/or let the header_rewrite plugin > to know about the X-From-Apache header in the original response? > Yeah, I don't mean to imply at any point that ATS is doing the wrong thing. I'm just trying to make it do something different :) Your #1-5 sounds correct. Interestingly, for the 304s, the X-From-Apache header doesn't even get logged using the custom log %<{X-From-Apache}ssh> tag (though it does get logged successfully for non-IMS requests just fine). The background is that I'm working on fronting existing web servers with ATS. The existing Apache servers use the (real) headers I'm trying to add in their logging, so I'm trying to get those same headers working with ATS so I can avoid overhauling the log processing that's already in place (it's a fairly big infrastructure, so it wouldn't be a trivial thing to do -- so non-trivial that I'd rather modify the source code of ATS). Everything else works great and I thought I was pretty much done, since I'd only ever tested non-conditional requests. But those have tripped me up a bit, so I'm looking for workarounds. --20cf300e4e51b989e404ebd33e02 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Fri, Nov 22, 2013 at 7:24 PM, Shu Kit Chan <chanshu= kit@gmail.com> wrote:
I think the problem = is not with the plugin. The debug log is telling us that, i think.=A0
W= e can add a static header to the 304 response with no problem.

The situation is that -=A0

1) There is a custom header (X-From-Apache) in the orig= inal response from origin server.
2) This response is cached in A= TS
3) When client uses IMS in the request, ATS responds with a 30= 4.=A0
4) The custom header is nowhere to be found in the 304 respond
5) And thus the header_rewrite plugin cannot get its value.
I think ATS is doing the right thing for 304 as mentioned here= -=A0http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.= html#sec10.3.5
So how do we override this behavior and/or let the header_rewrite plug= in to know about the X-From-Apache header in the original response?=A0

Yeah, I don't mean to imply at = any point that ATS is doing the wrong thing. I'm just trying to make it= do something different :)

Your #1-5 sounds correct. Interestingly, for the 304s, the X= -From-Apache header doesn't even get logged using the custom log %<{= X-From-Apache}ssh> tag (though it does get logged successfully
for non-IMS requests just fine).

The back= ground is that I'm working on fronting existing web servers with ATS. T= he existing Apache servers use the (real) headers I'm trying to add in = their logging, so I'm trying to get those
same headers working with ATS so I can avoid overhauling the log= processing that's already in place (it's a fairly big infrastructu= re, so it wouldn't be a trivial thing to do -- so non-trivial that I= 9;d rather
modify the source code of ATS).

Everything else works great and I th= ought I was pretty much done, since I'd only ever tested non-conditiona= l requests. But those have tripped me up a bit, so I'm looking for work= arounds.
--20cf300e4e51b989e404ebd33e02--