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 2007/03/19 08:02:40 UTC

DO NOT REPLY [Bug 41885] New: - "AddType application/x-type-map" Still in Use (Not backwards-compatibility)

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41885>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41885

           Summary: "AddType application/x-type-map" Still in Use (Not
                    backwards-compatibility)
           Product: Apache httpd-2
           Version: 2.2.4
          Platform: All
               URL: http://httpd.apache.org/docs/2.2/content-
                    negotiation.html#type-map
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Documentation
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: imacat@mail.imacat.idv.tw


Dear all,

    Hi.  This is imacat from Taiwan.  In the Apache 2.2 documentation:

http://httpd.apache.org/docs/2.2/content-negotiation.html#type-map

    "A type map is a document which is associated with the handler named
type-map (or, for backwards-compatibility with older Apache configurations, the
MIME-type application/x-type-map)."

    I tried and get really confused with this for several days of working. 
After digging into mod_negotiation.c it turned out that the MIME-type
"application/x-type-map" is still in use.  It is NOT only for
backwards-compatibility, as static.  If you create a type map page.html.var for
the URL page.html and expect it to work, as the example on the documentation
says, you have to:

    1. Turn on MultiViews.
    2. Add this line: "AddType application/x-type-map .var".

    This is contrary to what the documentation says.  As a result, the example
won't work if you follow the documentation.

    I think this should be corrected.

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

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


DO NOT REPLY [Bug 41885] - "AddType application/x-type-map" Still in Use (Not backwards-compatibility)

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41885>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41885


imacat@mail.imacat.idv.tw changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WORKSFORME                  |




------- Additional Comments From imacat@mail.imacat.idv.tw  2007-03-19 12:32 -------
    Well, I believe you did not read my report carefully.  It does not work IN
CERTAIN CONDITION.  To be specific, in the example stated in the documentation.
 I have created a simple test case and attached a console log so that you can
examing it.  It is excactly the example in the documentation, not a single word
changed.

    Please tell me if you need any more information.  And, PLEASE, do not close
a bug so quickly.

=====================
imacat@rine ~ % ls /tmp/apache/htdocs
foo.en.html  foo.fr.de.html  foo.var
imacat@rine ~ % cat /tmp/apache/htdocs/foo.var
URI: foo

URI: foo.en.html
Content-type: text/html
Content-language: en

URI: foo.fr.de.html
Content-type: text/html;charset=iso-8859-2
Content-language: fr, de
imacat@rine ~ % cat /tmp/apache/htdocs/foo.en.html
This is foo.en.html.
imacat@rine ~ % cat /tmp/apache/htdocs/foo.fr.de.html
This is foo.fr.de.html.
imacat@rine ~ % cat /tmp/apache/request
GET /foo HTTP/1.1
Host: localhost
Accept-Language: de,en;q=0.5
Connection: close

imacat@rine ~ % cat /tmp/apache/httpd-00.conf
User nobody
Group nogroup
ServerName localhost
ServerAdmin webmaster@localhost
ServerRoot /tmp/apache
DocumentRoot /tmp/apache/htdocs
PidFile /tmp/apache/httpd.pid
LoadModule mime_module /usr/lib/apache2/mod_mime.so
LoadModule negotiation_module /usr/lib/apache2/mod_negotiation.so
Listen 50080
ErrorLog /tmp/apache/error_log

AddHandler type-map .var
imacat@rine ~ % /usr/sbin/httpd -f /tmp/apache/httpd-00.conf
imacat@rine ~ % nc localhost 50080 < /tmp/apache/request
HTTP/1.1 404 Not Found
Date: Mon, 19 Mar 2007 19:22:31 GMT
Server: Apache/2.2.4 (Unix)
Content-Length: 201
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /foo was not found on this server.</p>
</body></html>
imacat@rine ~ % kill $(</tmp/apache/httpd.pid)
imacat@rine ~ % cat /tmp/apache/httpd-m0.conf
User nobody
Group nogroup
ServerName localhost
ServerAdmin webmaster@localhost
ServerRoot /tmp/apache
DocumentRoot /tmp/apache/htdocs
PidFile /tmp/apache/httpd.pid
LoadModule mime_module /usr/lib/apache2/mod_mime.so
LoadModule negotiation_module /usr/lib/apache2/mod_negotiation.so
Listen 50080
ErrorLog /tmp/apache/error_log

AddHandler type-map .var
Options +MultiViews
imacat@rine ~ % /usr/sbin/httpd -f /tmp/apache/httpd-m0.conf
imacat@rine ~ % nc localhost 50080 < /tmp/apache/request
HTTP/1.1 404 Not Found
Date: Mon, 19 Mar 2007 19:22:35 GMT
Server: Apache/2.2.4 (Unix)
Content-Length: 201
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /foo was not found on this server.</p>
</body></html>
imacat@rine ~ % kill $(</tmp/apache/httpd.pid)
imacat@rine ~ % cat /tmp/apache/httpd-0t.conf
User nobody
Group nogroup
ServerName localhost
ServerAdmin webmaster@localhost
ServerRoot /tmp/apache
DocumentRoot /tmp/apache/htdocs
PidFile /tmp/apache/httpd.pid
LoadModule mime_module /usr/lib/apache2/mod_mime.so
LoadModule negotiation_module /usr/lib/apache2/mod_negotiation.so
Listen 50080
ErrorLog /tmp/apache/error_log

AddHandler type-map .var
AddType application/x-type-map .var
imacat@rine ~ % /usr/sbin/httpd -f /tmp/apache/httpd-0t.conf
imacat@rine ~ % nc localhost 50080 < /tmp/apache/request
HTTP/1.1 404 Not Found
Date: Mon, 19 Mar 2007 19:22:39 GMT
Server: Apache/2.2.4 (Unix)
Content-Length: 201
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /foo was not found on this server.</p>
</body></html>
imacat@rine ~ % kill $(</tmp/apache/httpd.pid)
imacat@rine ~ % cat /tmp/apache/httpd-mt.conf
User nobody
Group nogroup
ServerName localhost
ServerAdmin webmaster@localhost
ServerRoot /tmp/apache
DocumentRoot /tmp/apache/htdocs
PidFile /tmp/apache/httpd.pid
LoadModule mime_module /usr/lib/apache2/mod_mime.so
LoadModule negotiation_module /usr/lib/apache2/mod_negotiation.so
Listen 50080
ErrorLog /tmp/apache/error_log

AddHandler type-map .var
AddType application/x-type-map .var
Options +MultiViews
imacat@rine ~ % /usr/sbin/httpd -f /tmp/apache/httpd-mt.conf
imacat@rine ~ % nc localhost 50080 < /tmp/apache/request
HTTP/1.1 200 OK
Date: Mon, 19 Mar 2007 19:22:43 GMT
Server: Apache/2.2.4 (Unix)
Content-Location: foo.fr.de.html
Vary: negotiate,accept-language,accept-charset
TCN: choice
Last-Modified: Mon, 19 Mar 2007 19:06:24 GMT
ETag: "2a9687-18-42c0c49122c00;2a9630-a1-42c0c47486880"
Accept-Ranges: bytes
Content-Length: 24
Connection: close
Content-Type: text/html

This is foo.fr.de.html.
imacat@rine ~ % kill $(</tmp/apache/httpd.pid)
imacat@rinse ~ %


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

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


DO NOT REPLY [Bug 41885] - "AddType application/x-type-map" Still in Use (Not backwards-compatibility)

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41885>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41885





------- Additional Comments From imacat@mail.imacat.idv.tw  2007-03-19 12:35 -------
Created an attachment (id=19743)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=19743&action=view)
The Test Case That I Used, All the 4 Configuration Files and the Script

Please examine the test case I attached.

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

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


DO NOT REPLY [Bug 41885] - Can't use type-map handler with MultiViews

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41885>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41885





------- Additional Comments From imacat@mail.imacat.idv.tw  2007-03-19 20:53 -------
(In reply to comment #4)
> Type-maps do indeed work as documented. You are *not* supposed to be combining
> type-maps with MultiViews -- they are alternatives (they docs say "This is done
> in one of two ways", not "use both of these").

    Yes, I'm not supposed to do so.  I don't know that I have to do so in order
to get the documented example working after several days of trying.

    Please understand that I classify this as a "bug in the documentation". 
Since I have looked into the code, I do understand its logic.

    The last sentence in the second paragraph under the heading "Using a
type-map file" says:

http://issues.apache.org/bugzilla/show_bug.cgi?id=41885#add_comment

    "This file would be named foo.var, as it describes a resource named foo."

    In an earlier paragraph "About Content Negotiation", the first sentence of
the last paragraph:

http://httpd.apache.org/docs/2.2/content-negotiation.html#about

    "A resource is a conceptual entity identified by a URI (RFC 2396)."

    As for "a resource named foo", what's wrong if I request for foo?  Am I
supposed to request "foo.var" for "a resource named foo"?

    Also, the second paragraph under "Using a type-map file":

    "It is conventional to begin a map file with an entry for the combined
entity as a whole (although this is not required, and if present will be ignored)."

    I suppose this means the first line "URI: foo" in the example.  So I request
the "combined entity", the "foo".  What's wrong with this anyway?  If there is
no such combined entity "foo", why does it say so?  If foo.var is describing a
resource named foo.var, shouldn't it be documented this way?

> If you have
> AddHandler type-map .var
> then you need to request the file including the .var extension.  Check
> conf/extra/httpd-manual.conf to see how it is done (where .html is designated as
> being a type-map).

    Actually, it is the first thing I checked, even before I read the
documentation, in order to get our local documentation copy working.

> But it seems there is some code trying to handle that case, so I'll leave this
> bug report open in case anyone is interested in trying to make it work more
> predictably.

    Please fix this in the documentation.  I would not like to see another one
wasting so much time on this.

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

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


DO NOT REPLY [Bug 41885] - "AddType application/x-type-map" Still in Use (Not backwards-compatibility)

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41885>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41885


slive@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WORKSFORME




------- Additional Comments From slive@apache.org  2007-03-19 11:40 -------
AddHandler type-map
certainly does work.  We use it on apache.org.

There must be something else going on in your config.

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

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


DO NOT REPLY [Bug 41885] - Can't use type-map handler with MultiViews

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41885>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41885


slive@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|"AddType application/x-type-|Can't use type-map handler
                   |map" Still in Use (Not      |with MultiViews
                   |backwards-compatibility)    |




------- Additional Comments From slive@apache.org  2007-03-19 19:44 -------
Type-maps do indeed work as documented. You are *not* supposed to be combining
type-maps with MultiViews -- they are alternatives (they docs say "This is done
in one of two ways", not "use both of these").  

If you have
AddHandler type-map .var
then you need to request the file including the .var extension.  Check
conf/extra/httpd-manual.conf to see how it is done (where .html is designated as
being a type-map).

When you try to combine MultiViews and type-maps, things get really confusing. I
wouldn't recommend it at all, and the fact that you got it to work using a
backward-compat feature is probably accidental.

But it seems there is some code trying to handle that case, so I'll leave this
bug report open in case anyone is interested in trying to make it work more
predictably.

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

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