RESOLVED FIXED 228566
[WPE][GTK] .asc file extension is appended to filename of text/plain downloads
https://bugs.webkit.org/show_bug.cgi?id=228566
Summary [WPE][GTK] .asc file extension is appended to filename of text/plain downloads
Michael Catanzaro
Reported 2021-07-28 13:53:32 PDT
Our MIMETypeRegistry::preferredExtensionForMIMEType returns "asc" for text/plain, possibly because "asc" sorts alphabetically ahead of all other possible file extensions for text/plain, and we just pick the first one. E.g. try downloading the backtrace from https://bugzilla.redhat.com/show_bug.cgi?id=1985053 with WebKit and note that it gets named "backtrace.asc" indicating that it is a GPG signature. But if downloaded with Firefox, it just gets named "backtrace" which is the intended result. I don't know how to fix it, but we don't need to, because we don't really want to append any file extension for text/plain anyway. That's just annoying. If I download a file named "backtrace" then I don't want it renamed to "backtrace.txt". That would be expected on Windows, but certainly not from WebKitGTK. So I think it's reasonable to have a special case for text/plain.
Attachments
Patch (5.81 KB, patch)
2021-07-28 14:16 PDT, Michael Catanzaro
no flags
Michael Catanzaro
Comment 1 2021-07-28 14:16:07 PDT
Adrian Perez
Comment 2 2021-07-29 05:56:54 PDT
Comment on attachment 434466 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=434466&action=review > Source/WebCore/platform/xdg/MIMETypeRegistryXdg.cpp:60 > + return String(); This looks reasonable to me.
EWS
Comment 3 2021-07-29 07:56:31 PDT
Committed r280422 (240062@main): <https://commits.webkit.org/240062@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 434466 [details].
Note You need to log in before you can comment on or make changes to this bug.