You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Eric Covener <co...@gmail.com> on 2015/02/16 15:58:34 UTC

replacing Date header

There are lots of non-mod_proxy modules that act as a proxy of one
sort or another -- shouldn't we just respect their date header if they
issue one?

modules/http/http_filters.c

    /*
     * keep the set-by-proxy server and date headers, otherwise
     * generate a new server header / date header
     */
    if (r->proxyreq != PROXYREQ_NONE) {
        proxy_date = apr_table_get(r->headers_out, "Date");
        if (!proxy_date) {
            /*
             * proxy_date needs to be const. So use date for the creation of
             * our own Date header and pass it over to proxy_date later to
             * avoid a compiler warning.
             */
            date = apr_palloc(r->pool, APR_RFC822_DATE_LEN);
            ap_recent_rfc822_date(date, r->request_time);
        }
        server = apr_table_get(r->headers_out, "Server");
    }
    else {
        date = apr_palloc(r->pool, APR_RFC822_DATE_LEN);
        ap_recent_rfc822_date(date, r->request_time);
    }

    form_header_field(&h, "Date", proxy_date ? proxy_date : date );

-- 
Eric Covener
covener@gmail.com

Re: replacing Date header

Posted by Yann Ylavic <yl...@gmail.com>.
On Mon, Feb 16, 2015 at 3:58 PM, Eric Covener <co...@gmail.com> wrote:
> There are lots of non-mod_proxy modules that act as a proxy of one
> sort or another -- shouldn't we just respect their date header if they
> issue one?

+1

Re: replacing Date header

Posted by André Malo <nd...@perlig.de>.
* Tim Bannister wrote:

> On 17 Feb 2015, at 22:21, André Malo <nd...@perlig.de> wrote:
> > However, I always saw this Date header handling as a way to enforce RFC
> > compliance (e.g. to overwrite Date-headers in mod_asis handlers and
> > crappy backends). Wrong Date headers may have a huge impact, as I see
> > it. But then, maybe I'm overrating that.
>
> So maybe the logic should be to preserve a Date: header iff it is
> compliant with the relevant RFC? With this, modules that want a Date:
> header automatically added need only to ensure they don't assert an
> apparently valid Date header.

Hmm, which would be the current (!) server time in the correct format. We 
might need to define some epsilon time which is still acceptable or so.

... it's probably cheaper to keep it as it is right now ;-)

nd
-- 
Winnetous Erbe: <http://pub.perlig.de/books.html#apache2>

Re: replacing Date header

Posted by Tim Bannister <is...@c8h10n4o2.org.uk>.
On 17 Feb 2015, at 22:21, André Malo <nd...@perlig.de> wrote:
> 
> * Eric Covener wrote:
> 
>> Java application servers like WebSphere and WebLogic provide Apache modules like this.  I don't know how to address the "why", I just want to remove the special treatment for mod_proxy / r->proxyreq and only set a Date if one wasn't provided by the handler.  The user I was working with didn't fully understand how how his software re-used the value in the Date header as sent in the handler.
> 
> Uhm, I have no real idea about those, but are they not integrated with the proxy framework? ajp?
> 
> However, I always saw this Date header handling as a way to enforce RFC compliance (e.g. to overwrite Date-headers in mod_asis handlers and crappy backends). Wrong Date headers may have a huge impact, as I see it. But then, maybe I'm overrating that.

So maybe the logic should be to preserve a Date: header iff it is compliant with the relevant RFC? 
With this, modules that want a Date: header automatically added need only to ensure they don't assert an apparently valid Date header.

-- 
Tim Bannister – +44 7980408788 – isoma@c8h10n4o2.org.uk


Re: replacing Date header

Posted by André Malo <nd...@perlig.de>.
* Eric Covener wrote:

> On Tue, Feb 17, 2015 at 4:05 PM, André Malo <nd...@perlig.de> wrote:
> >> There are lots of non-mod_proxy modules that act as a proxy of one
> >> sort or another -- shouldn't we just respect their date header if they
> >> issue one?
> >
> > Hmm, I'm actually wondering why. And which ones would that be?
>
> Java application servers like WebSphere and WebLogic provide Apache
> modules like this.  I don't know how to address the "why", I just want
> to remove the special treatment for mod_proxy / r->proxyreq and only
> set a Date if one wasn't provided by the handler.  The user I was
> working with didn't fully understand how how his software re-used the
> value in the Date header as sent in the handler.

Uhm, I have no real idea about those, but are they not integrated with the 
proxy framework? ajp?

However, I always saw this Date header handling as a way to enforce RFC 
compliance (e.g. to overwrite Date-headers in mod_asis handlers and crappy 
backends). Wrong Date headers may have a huge impact, as I see it.
But then, maybe I'm overrating that.

nd
-- 
s  s^saaaaaoaaaoaaaaooooaaoaaaomaaaa  a  alataa  aaoat  a  a
a maoaa a laoata  a  oia a o  a m a  o  alaoooat aaool aaoaa
matooololaaatoto  aaa o a  o ms;s;\s;s;g;y;s;:;s;y#mailto: #
 \51/\134\137| http://www.perlig.de #;print;# > nd@perlig.de

Re: replacing Date header

Posted by Eric Covener <co...@gmail.com>.
On Tue, Feb 17, 2015 at 4:05 PM, André Malo <nd...@perlig.de> wrote:
>> There are lots of non-mod_proxy modules that act as a proxy of one
>> sort or another -- shouldn't we just respect their date header if they
>> issue one?
>
> Hmm, I'm actually wondering why. And which ones would that be?

Java application servers like WebSphere and WebLogic provide Apache
modules like this.  I don't know how to address the "why", I just want
to remove the special treatment for mod_proxy / r->proxyreq and only
set a Date if one wasn't provided by the handler.  The user I was
working with didn't fully understand how how his software re-used the
value in the Date header as sent in the handler.

Re: replacing Date header

Posted by André Malo <nd...@perlig.de>.
* Eric Covener wrote:

> There are lots of non-mod_proxy modules that act as a proxy of one
> sort or another -- shouldn't we just respect their date header if they
> issue one?

Hmm, I'm actually wondering why. And which ones would that be?

nd
-- 
my @japh = (sub{q~Just~},sub{q~Another~},sub{q~Perl~},sub{q~Hacker~});
my $japh = q[sub japh { }]; print join       #########################
 [ $japh =~ /{(.)}/] -> [0] => map $_ -> ()  #            André Malo #
=> @japh;                                    # http://www.perlig.de/ #