https://issues.apache.org/bugzilla/show_bug.cgi?id=45118
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
AssignedTo: [email protected]
ReportedBy: [EMAIL PROTECTED]
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
http://myserver.mydomain.com/Welcome.html
GET http://myserver.mydomain.com/Welcome.html --> 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-Peer: 212.85.38.184:80
Client-Response-Num: 1
Link: <http://myserver.mydomain.com/astellaska.css>; rel="stylesheet";
type="text/css"
Title: MEDICAL AFFAIRS - SCIENTIFIC INFORMATION - WELCOME
X-Meta-Generator: Microsoft FrontPage 6.0
X-Meta-Template: C:\PROGRAMME\MICROSOFT OFFICE\OFFICE\html.dot
case 2 :
dent:/var/NFS# lwp-request -m GET -Sed
http://myserver.mydomain.com/Welcome.iso.html
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
http://myserver.mydomain.com/Welcome.none.html
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
[...]
</IfModule>
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
header.
--
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]