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 15884] - ISAPI: set Content-type header to the DefaultType configuration value
Date Wed, 29 Jan 2003 20:11:52 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15884>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15884

ISAPI: set Content-type header to the DefaultType configuration value

laimis@tic.lt changed:

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



------- Additional Comments From laimis@tic.lt  2003-01-29 20:11 -------
Removing the DefaultType directive does not correct the problem.

The problem is that module 'mod_isapi' ignores the DefaultType directive or 
does not have its own directive to control the default type for objects 
returned by ISAPI extension.

Now, the default Content-Type header for entity-body returned by ISAPI 
extension is determined by the file extension of ISAPI module called.

For example: we have lines in httpd.conf file:

DefaultType text/html
AddHandler isapi-isa .dll
ISAPICacheFile isapi.dll

If isapi.dll does not specify Content-Type header in its response, Apache 
automatically appends the 'Content-Type: application/octet-stream' header to 
the HTTP response, so forcing some browsers (Netscape, Mozilla) to download 
the generated html as file instead of displaying it.

After renaming isapi.dll to isapi.zip:

DefaultType text/html
AddHandler isapi-isa .zip
ISAPICacheFile isapi.zip

Apache appends the 'Content-Type: application/zip' header to the HTTP response.

Renaming isapi.dll to isapi.htm is another (funny) workaround for the problem: 
Apache appends the desired 'Content-Type: text/html' header.


Suggestions for solution are:

1. (Simple to correct) Do not ignore DefaultType directive for entity-body 
returned by ISAPI extension. Just add one line of code [ap_set_content_type(r, 
NULL)] before calling ISAPI HttpExtensionProc handler; or create another 
directive for that.

2. (Microsoft way) Do not automatically add a Content-Type header for ISAPI 
extensions. It is the script's responsibility to set this value, if desired. 
According to RFC 2616, if the media type is not given by a Content-Type field, 
the recipient MAY attempt to guess the media type.

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


Mime
View raw message