Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mungo should respect existing MIME types #1

Closed
mamurphy opened this issue Dec 5, 2017 · 2 comments
Closed

Mungo should respect existing MIME types #1

mamurphy opened this issue Dec 5, 2017 · 2 comments

Comments

@mamurphy
Copy link
Member

mamurphy commented Dec 5, 2017

Reported by jschulz on 1 Jan 1970 00:19 UTC
Mungo currently defaults to serving all files as text/html. It should try to use any existing Apache (mod_mime) settings before finally falling back to text/html.

'''To reproduce''', add the following to httpd.conf

<Files ~ (\.(asp|css|js|html|xml))>    
   SetHandler  perl-script
   PerlSetVar StatINC 1
   PerlHandler Mungo
</Files>

Now, all files with those extensions will be served as text/html, even JavaScript and CSS.
If a doctype of:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                                "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

is added, the page will "break" because the CSS and JavaScript will not be recognized as the appropriate type of file.

The page will lack any CSS styling and any JavaScript will not function.

'''Remedy:'''
You can add the following to httpd.conf

<Files ~ (\.(css))> 
   PerlSetVar MungoContentType 'text/css'
</Files>

<Files ~ (\.(js))> 
   PerlSetVar MungoContentType 'text/javascript'
</Files>

<Files ~ (\.(xml))> 
   PerlSetVar MungoContentType 'text/xml'
</Files>

but Mungo should respect (or at least try to obtain) those types already set in conf/mime.types.

If reading from conf/mime.types is too difficult/expensive, a single place (mungo.mime ?) to record all those associations would be appreciated.

@mamurphy
Copy link
Member Author

mamurphy commented Dec 5, 2017

Comment by jesus on 1 Jan 1970 00:19 UTC
(In [5]) fixes #1

@mamurphy
Copy link
Member Author

mamurphy commented Dec 5, 2017

Modified by clinton on 1 Jan 1970 00:20 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant