Cleanup and test MIMETypeUtilities • fileExtensionForURL ending in "script.min.js" produces ".min.js" expected ".js" • fileExtensionForMIMEType for "application/vnd.api+json" produces `null` expected "json"
Created attachment 320472 [details] [PATCH] Proposed Fix
Comment on attachment 320472 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=320472&action=review r=me > LayoutTests/inspector/unit-tests/mimetype-utilities.html:24 > + InspectorTest.expectEqual(WI.fileExtensionForURL("https://example.com/script.min.js"), "js", `File extension for "script.min.js" should be "js".`); Should there also be a test for filenames with a trailing period? I know it's odd but AFAIK it is allowed (on UNIX and Windows at least). Also, WI.fileExtensionForURL("https://example.com/foo.") returns "" instead of null. This should probably return null for consistency
Created attachment 320491 [details] [PATCH] For Landing
> Should there also be a test for filenames with a trailing period? I know > it's odd but AFAIK it is allowed (on UNIX and Windows at least). > > Also, WI.fileExtensionForURL("https://example.com/foo.") returns "" instead > of null. This should probably return null for consistency Sounds good. Added.
Comment on attachment 320491 [details] [PATCH] For Landing Clearing flags on attachment: 320491 Committed r221891: <http://trac.webkit.org/changeset/221891>
<rdar://problem/34693513>