httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 49308] New: many mod_headers response header treatments do not work for file and cgi content
Date Tue, 18 May 2010 17:28:55 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=49308

           Summary: many mod_headers response header treatments do not
                    work for file and cgi content
           Product: Apache httpd-2
           Version: 2.2.15
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_headers
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: apache@misc.lka.org.lu


When used together with file content (index.html) or CGI, mod_headers behaves
as if its response header treatment runs _before_ content generation, and not
afterwards.

"set", "append" and "merge" behave like "add", adding another instance of a
header, instead of replacing (or appending to) it (... because I suppose, it
actually runs before the script, so it "sets" the header, and then the script
"adds" his)

"edit", "unset" don't do anything at all (because, they run before the script,
and thus have nothing to work on).

This is observed over a wide range of Apache versions, and can be seen on
2.2.8, 2.2.11, 2.2.14 and 2.2.15

However, if 2 Header directives are present operating on the same header, then
the second does operate correctly on the result left by the first.

Test case:

index.cgi

#!/bin/sh

echo Content-Type: text/plain
echo Test-set: a1
echo Test-append: b1
echo Test-edit: c1
echo Test-merge: d1
echo Test-add: e1
echo Test-unset: f1
echo
echo xyz


.htaccess:

Options +ExecCGI
AddHandler cgi-script .cgi

Header set Test-set a2
Header append Test-append b2
Header edit Test-edit c xx1
Header add Test-add e2
Header unset Test-unset
Header append Test-double-append g1
Header append Test-double-append g2

Output (of curl -D - http://localhost/~alain/header/index.cgi):

HTTP/1.1 200 OK
Date: Tue, 18 May 2010 17:25:41 GMT
Server: Apache/2.2.14 (Ubuntu)
Test-set: a1
Test-append: b1
Test-edit: c1
Test-merge: d1
Test-add: e1
Test-unset: f1
Test-set: a2
Test-append: b2
Test-merge: d1
Test-add: e2
Test-double-append: g1, g2
Transfer-Encoding: chunked
Content-Type: text/plain

xyz


Expected:

HTTP/1.1 200 OK
Date: Tue, 18 May 2010 17:25:41 GMT
Server: Apache/2.2.14 (Ubuntu)
Test-set: a2
Test-append: b1, b2
Test-edit: xx11
Test-merge: d1
Test-add: e1
Test-add: e2
Test-double-append: g1, g2
Transfer-Encoding: chunked
Content-Type: text/plain

xyz

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message