httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 45118] New: Content-Type HTTP header generated twice
Date Mon, 02 Jun 2008 22:49:16 GMT

           Summary: Content-Type HTTP header generated twice
           Product: Apache httpd-2
           Version: 2.2.3
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core

When serving a normal local html static page, Apache 2.2.3 under some
circumstances generates 2 consecutive "Content-type" headers with conflicting
charset attributes. Example : I have 3 similar "welcome" pages : 
1) Welcome.html contains a html header line
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
2) Welcome.iso.html is the same with a different header line
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
3) Welcome.none.html is the same but does not contain such a META line.

Using perl's "lwp-request" to get the page and see what the server actually
gets as HTTP headers I obtain (except that I changed the server's hostname) :
case 1 :
dent:/var/NFS# lwp-request -m GET -Sed
GET --> 200 OK
Connection: close
Date: Mon, 02 Jun 2008 22:30:29 GMT
Accept-Ranges: bytes
ETag: "186b6-47e5-44d495bec3240"
Server: Apache/2.2.3 (Debian) mod_jk/1.2.18 mod_perl/2.0.2 Perl/v5.8.8
Content-Length: 18405
Content-Type: text/html; charset=ISO-8859-1
Content-Type: text/html; charset=windows-1252
Last-Modified: Thu, 15 May 2008 18:49:37 GMT
Client-Date: Mon, 02 Jun 2008 22:30:29 GMT
Client-Response-Num: 1
Link: <>; rel="stylesheet";
X-Meta-Generator: Microsoft FrontPage 6.0

case 2 : 
dent:/var/NFS# lwp-request -m GET -Sed
Response : the same but the 2 Content-Type lines are now :
Content-Type: text/html; charset=ISO-8859-1
Content-Type: text/html; charset=iso-8859-1

case 3 :
dent:/var/NFS# lwp-request -m GET -Sed
response : only a single Content-Type line :
Content-Type: text/html; charset=ISO-8859-1

The server conf file contains a section :
<IfModule mod_mime.c>
 AddDefaultCharset ISO-8859-1

If I take out the AddDefaultCharset, then I get a first Content-Type header
with UTF-8 as the default charset, which creates browser display problems with
the pages.
But what seems to happen is that Apache, upon encountering such a <META
HTTP-EQUIV="Content-Type" ..> line in the html page it serves, *adds* this
content-type line to the default one, instead of replacing the default one.
Different browsers seems to react differently to the duplicate Content-Type

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message