You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2008/06/03 00:49:16 UTC

DO NOT REPLY [Bug 45118] New: Content-Type HTTP header generated twice

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: bugs@httpd.apache.org
        ReportedBy: aw@ice-sa.com


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: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 45118] Content-Type HTTP header generated twice

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45118


Ruediger Pluem <rp...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO




--- Comment #1 from Ruediger Pluem <rp...@apache.org>  2008-06-03 02:13:14 PST ---
Have you tried if this also happens with
1. A later vanilla build version of httpd?
2. Without mod_perl activated?


-- 
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


DO NOT REPLY [Bug 45118] Content-Type HTTP header generated twice

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45118


Nick Kew <ni...@webthing.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|                            |INVALID




--- Comment #2 from Nick Kew <ni...@webthing.com>  2008-06-03 03:52:06 PST ---
This is lwp behaviour: it parses the <meta> and inserts it as if it were a
header.
(this happens clientside).


-- 
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


DO NOT REPLY [Bug 45118] Content-Type HTTP header generated twice

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45118





--- Comment #3 from andre w <aw...@ice-sa.com>  2008-06-03 04:19:43 PST ---

(In reply to comment #2)

You are right, I just verified this with a Telnet session, which does not show
the duplicate header. Sorry for the wrong bug report.
Who would have thunk lwp does such strange things ?

A related question however : as per the original bug report, if I remove the 
AddDefaultCharset iso-8859-1 
line in the Apache configuration file, then I automatically get a 
Content-Type: text/html; charset=UTF-8
header for html documents.

Where does that come from ?  Does Apache / mod_mime check some attribute of the
files served and decides this is UTF-8 ? or is there another configuration
parameter that I am missing ?

(please direct me to the appropriate list if this is not the right place for
this question)


-- 
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