JDK-8186148 : Few extension to MIME type mappings are missing
Type:Bug
Component:javafx
Sub-Component:web
Affected Version:8,9,10
Priority:P4
Status:Resolved
Resolution:Fixed
Submitted:2017-08-11
Updated:2020-01-31
Resolved:2017-08-18
The Version table provides details related to the release that this issue/RFE will be addressed.
Unresolved : Release in which this issue/RFE will be addressed. Resolved: Release in which this issue/RFE has been resolved. Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.
Some of the extension to MIME mapping is missing in our Java Port.
e.g. .xht should be mapped to application/xhtml+xml
Comments
changeset: 819c06716e82
user: arajkumar
date: Fri Aug 18 14:04:21 2017 +0530
description:
8186148: Few extension to MIME type mappings are missing
Reviewed-by: ghb, mbilla, kcr
URL: http://hg.openjdk.java.net/openjfx/10-dev/rt/rev/819c06716e82
18-08-2017
Actually we don't support .cur and .ico decoding from javafx image io. Please see JDK-8092240 and JDK-8134547.
17-08-2017
+1
I guess you can run unit test cases related to image decoding to see any side effect.
16-08-2017
OK, thanks.
+1
16-08-2017
These changes comes into action only for the local files(jar:, file:), not for the downloaded contents from http server. I don't see any impact because of this change.
Also 'image/x-icon' is already added in supported image format, Please see http://hg.openjdk.java.net/openjfx/10-dev/rt/file/c38fbae55fc8/modules/javafx.web/src/main/native/Source/WebCore/platform/MIMETypeRegistry.cpp#l229
16-08-2017
Is there any possible behavior change with changing from image/ico to image/x-icon? One place (a blog post I think) suggested that image/x-icon is correct if the format actually in icon (.ico) format, but that image/ico is correct if you are passing a png or jpg file as an icon or cursor. Here is the link:
https://perishablepress.com/everything-you-ever-wanted-to-know-about-favicons/
16-08-2017
So then the question will be whether to retain the existing behaviour or not ? May be Kevin can clarify..
16-08-2017
+1
16-08-2017
image/x-icon seems to be correct according to various internet sources,
https://github.com/paulirish/html5-boilerplate/commit/37b5fec090d00f38de64b591bcddcb205aadf8ee
https://stackoverflow.com/questions/13827325/correct-mime-type-for-favicon-ico
https://en.wikipedia.org/wiki/ICO_(file_format)#MIME_type
16-08-2017
One query:
Looks like the new change overridden the below: But looks like image/ico OR image/icon is still widely used. Any thoughts on this?
From :
mimeTypeMap.put("ico", "image/ico");
mimeTypeMap.put("cur", "image/ico");
To
mimeTypeMap.put("ico", "image/x-icon");
mimeTypeMap.put("cur", "image/x-icon");
16-08-2017
http://cr.openjdk.java.net/~arajkumar/8186148/webrev
Other than adding few MIME types, removed duplicate mapping which present in Java side. Implementation is adopted from MIMETypeRegistryGtk.java.