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

SVG as image mimetype #28

Closed
matthewlein opened this issue Apr 24, 2014 · 8 comments
Closed

SVG as image mimetype #28

matthewlein opened this issue Apr 24, 2014 · 8 comments

Comments

@matthewlein
Copy link

I just uploaded a site using the stock htaccess, and the site uses a logo img with an svg source
<img src="img/logo.svg">

Chrome was giving me the old:
Resource interpreted as Image but transferred with MIME type text/xml

Simple fix was adding
AddType image/svg+xml svg
in my case on line 171

AddType text/cache-manifest appcache manifest

Now that people will be using SVG more often and in different ways: img, svg, object, background image, it might be good to include this as a default. I'm not sure if any others MIME types are needed for other use cases.

@alrra
Copy link
Member

alrra commented Apr 24, 2014

AddType image/svg+xml svg

@matthewlein You are most probably using Apache < v2.2.0. For the Apache versions that we support, Apache already provides that by default.

@alrra alrra closed this as completed Apr 24, 2014
@matthewlein
Copy link
Author

My httpd -v says
Apache/2.2.3
But for whatever reason it wasn't working without that addition. Not sure.

@alrra
Copy link
Member

alrra commented Apr 24, 2014

@matthewlein hmm, that is weird. Can you provide more details? What OS are you using? Are you using other configs? etc.

@alrra alrra reopened this Apr 24, 2014
@matthewlein
Copy link
Author

I don't have a lot of server-fu, but I got these details
Server version: Apache/2.2.3
Server built: Jan 10 2013 08:19:28
CentOS release 5.9 (Final)

If there's anything specific you want me to dig up, I can.

Plesk does the multiple domains setup, so it may be involved in some way.

This was a fresh site, no special configs at all, its a super basic single html page.

@matthewlein
Copy link
Author

Also just dug through /etc/mime.types and it is not listed there along all the other image types. So that seems to settle it.

The issue is here if anyone else needs the fix. You can decide if you want to roll it back to include it. IMO it doesn't hurt to have it, unless there is some performance hit.

@alrra
Copy link
Member

alrra commented Apr 24, 2014

/etc/mime.types

@matthewlein isn't it something like /etc/apache2|httpd|something_else/mime.types ?

it is not listed there along all the other image types.

@matthewlein great, thanks! Can you also look and see if the other two listed here are present or not?

You can decide if you want to roll it back to include it. I

@matthewlein will reintroduce it / them.

@matthewlein
Copy link
Author

Sure.
application/x-shockwave-flash swf is there, so you can leave that out.
image/x-icon ico is NOT there, it could be added back.

alrra added a commit that referenced this issue Apr 24, 2014
Not all Apache `v2.2.x+` servers seem to have the following
`filename expression` to `content type` mappings:

  * `ico` ↔ `image/x-icon`
  * `svg` ↔ `image/svg+xml`

Thanks @matthewlein.

Ref:   #28.
Close: #28.
@alrra
Copy link
Member

alrra commented Apr 24, 2014

Thanks @matthewlein, really appreciate your help!

@alrra alrra closed this as completed Apr 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants