зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1610810 - FTP download prompt appears while authentication dialog is displayed, r=valentin
Set nsFtpChannel's content-type to application/octet-stream only when downloading a file. Differential Revision: https://phabricator.services.mozilla.com/D61494 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
757aa81959
Коммит
68a2a76615
|
@ -6,7 +6,6 @@
|
|||
|
||||
#include "nsFTPChannel.h"
|
||||
#include "nsFtpConnectionThread.h" // defines nsFtpState
|
||||
#include "nsMimeTypes.h"
|
||||
|
||||
#include "nsThreadUtils.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
|
@ -92,7 +91,6 @@ nsresult nsFtpChannel::OpenContentStream(bool async, nsIInputStream** result,
|
|||
nsIChannel** channel) {
|
||||
if (!async) return NS_ERROR_NOT_IMPLEMENTED;
|
||||
|
||||
SetContentType(NS_LITERAL_CSTRING(APPLICATION_OCTET_STREAM));
|
||||
RefPtr<nsFtpState> state = new nsFtpState();
|
||||
|
||||
nsresult rv = state->Init(this);
|
||||
|
|
|
@ -1101,6 +1101,8 @@ nsFtpState::R_retr() {
|
|||
}
|
||||
|
||||
if (mResponseCode / 100 == 1) {
|
||||
mChannel->SetContentType(NS_LITERAL_CSTRING(APPLICATION_OCTET_STREAM));
|
||||
|
||||
Telemetry::ScalarAdd(
|
||||
Telemetry::ScalarID::NETWORKING_FTP_OPENED_CHANNELS_FILES, 1);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче