[users@httpd] Add header when access is denied

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear List,

According to the docs for mod_headers you can arange for the header to
be added either for sucessful requests only, or for all requests.  But
it seems to me that the "always" case doesn't really mean always, as the
header is not added when access has been denied.

Here's my particular example:

  Header always append Vary X-moz
  SetEnvIfNoCase X-moz prefetch prefetch
  Order allow,deny
  allow from all
  deny from env=prefetch

I'm trying to put a "Vary: X-moz" header in all responses.  Requests
that have "X-moz: prefetch" are denied.

The Vary: does get added when the request is sucessful:

$ wget -S (URL)
--23:07:19--
           => `index.html'
HTTP request sent, awaiting response...
 1 HTTP/1.1 200 OK
 2 Date: Wed, 16 Nov 2005 23:07:19 GMT
 3 Server: Apache/2.0
 4 Vary: X-moz,Accept-Encoding
 5 Last-Modified: Tue, 01 Nov 2005 18:40:18 GMT
 6 ETag: "64023-1b78-498d4880"
 7 Accept-Ranges: bytes
 8 Content-Length: 7032
 9 Keep-Alive: timeout=15, max=100
10 Connection: Keep-Alive
11 Content-Type: text/html

100%[====================================>] 7,032         --.--K/s


But when the request fails, it is not added:

$ wget --header="X-moz: prefetch" -S (URL)
--23:08:13--
           => `index.html.1'
HTTP request sent, awaiting response...
 1 HTTP/1.1 403 Forbidden
 2 Date: Wed, 16 Nov 2005 23:08:13 GMT
 3 Server: Apache/2.0
 4 Vary: accept-language,accept-charset
 5 Accept-Ranges: bytes
 6 Connection: close
 7 Content-Type: text/html; charset=iso-8859-1
 8 Content-Language: en
 9 Expires: Wed, 16 Nov 2005 23:08:13 GMT
23:08:13 ERROR 403: Forbidden.

This is with 2.0.54.

Is this the expected behaviour?  Is there anything I can do about it?

Cheers,
--Phil.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux