If http site redirects to an FTP download, the url bar doesn't show ftp:// protocol. If you copy the url from the bar, it does include the ftp:// though. STR: http://ftp1.digi.com/pub/shareware/unix/agetty/agetty21.tar Click cancel on download prompt. Note url bar doesn't show ftp:// Copy url. Note it is ftp://ftp1.digi.com/pub/shareware/unix/agetty/agetty21.tar
http://ftp1.digi.com/pub/shareware/unix/agetty/agetty21.tar responded the download content directly without redirect. How did you conclude the response was redirected?
I concluded that because when I copied the url, it was ftp://ftp1.digi.com/pub/shareware/unix/agetty/agetty21.tar instead of an http:// link that I had typed into the address bar.
Confirmed. It just copies a wrong URL, not a redirect bug. To reproduce, I had to type the http:// URL in the location bar (clicking the link didn't leave the URL on the location bar).
The problem is that nsDefaultURIFixup and utilityOverlay.js don't agree about what URI is likely to be FTP. https://mxr.mozilla.org/mozilla-central/source/docshell/base/nsDefaultURIFixup.cpp#530 https://mxr.mozilla.org/mozilla-central/source/browser/base/content/utilityOverlay.js#637
Created attachment 573169 [details] [diff] [review] Treat also ftp\d+ as FTP host.
Comment on attachment 573169 [details] [diff] [review] Treat also ftp\d+ as FTP host. You should adjust the comment above the line that you're changing in trimURL ("ftp\d*\."), and probably just copy the comment from urlbarBindings.xml's trimValue about the function not changing the URL such that calling createFixupURI will produce a different result.
Created attachment 573335 [details] [diff] [review] Treat also ftp\d+ as FTP host, for check in Thanks. Adjusted and add comments. Try submission result (before changing comments): https://tbpl.mozilla.org/?tree=Try&rev=0ba67c58de78
Thanks for the patch, Kimura-san!
Comment on attachment 573335 [details] [diff] [review] Treat also ftp\d+ as FTP host, for check in Requesting approval for branches because this is a regression since Firefox 7.
Comment on attachment 573335 [details] [diff] [review] Treat also ftp\d+ as FTP host, for check in [triage comment] Even though the reward looks low, the risk looks low as well. Approved for beta and aurora. Please land as soon as possible.
Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20100101 Firefox/9.0 Firefox Beta4 Mozilla/5.0 (X11; Linux x86_64; rv:10.0a2) Gecko/20111201 Firefox/10.0a2 Mozilla/5.0 (X11; Linux x86_64; rv:11.0a1) Gecko/20111202 Firefox/11.0a1 Verified on Ubuntu 11.10 using F9b4, Firefox Aurora and Nightly using the STR from comment 0. The Url is no longer trimmed for this url and thus the URl is copied appropriately.