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.
Created attachment 434466 [details] Patch
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.
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].