Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

fix MIME type for SVGs in data: URLs #8245

Closed
wants to merge 1 commit into from
Closed

fix MIME type for SVGs in data: URLs #8245

wants to merge 1 commit into from

Conversation

mroi
Copy link
Contributor

@mroi mroi commented Mar 2, 2016

The feature of inlining small images into style sheets by way of data: URLs does not work for me with SVG images. I test with Safari and it does not show the SVG, because the MIME type in the data: URL is set to image/svg instead of image/svg+xml. With the latter, everything works as expected.

So I took the liberty to add a switch statement here, in case more special handling is needed later for other file extensions.

The MIME type for SVG files should be image/svg+xml, not image/svg.
@leofeyer leofeyer added the defect label Mar 2, 2016
@leofeyer leofeyer added this to the 3.5.9 milestone Mar 2, 2016
@aschempp
Copy link
Member

aschempp commented Mar 3, 2016

Sounds reasonable but can you fix the coding style?

@leofeyer
Copy link
Member

leofeyer commented Mar 3, 2016

Never mind, I'll take care of it :)

@mroi
Copy link
Contributor Author

mroi commented Mar 3, 2016

Great, thanks. I copied the style from another switch statement with similar formatting further up in the same file. But this can of course be changed any way you see fit. Maybe you don’t want a switch here at all, if you don’t expect further need for future customization.

@leofeyer
Copy link
Member

Fixed in 8e6f3f8.

@leofeyer leofeyer closed this Mar 16, 2016
@mroi mroi deleted the patch-2 branch March 16, 2016 13:40
jsonn pushed a commit to jsonn/pkgsrc that referenced this pull request Mar 26, 2016
### 4.1.2 (2016-03-22)

 * Handle derived classes in the exception converter (see #462).
 * Prevent the autofocus attribute from being added multiple times (see contao/core#8281).
 * Respect the SSL settings of the root page when generating sitemaps (see contao/core#8270).
 * Read from the temporary file if it has not been closed yet (see contao/core#8269).
 * Always use HTTPS if the target server supports SSL connections (see contao/core#8183).
 * Adjust the meta wizard field length to the column length (see contao/core#8277).
 * Correctly handle custom mime icon paths (see contao/core#8275).
 * Show the 404 error page if an unpublished article is requested (see contao/core#8264).
 * Correctly count the URLs when rebuilding the search index (see contao/core#8262).
 * Ensure that every image has a width and height attribute (see contao/core#8162).
 * Set the correct mime type when embedding SVG images (see contao/core#8245).
 * Handle the "float_left" and "float_right" classes in the back end (see contao/core#8239).
 * Consider the fallback language if a page alias is ambiguous (see contao/core#8142).
 * Fix the error 403/404 redirect (see contao/website#74).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants