зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1639247 - Isolate DNS cache per first-party when privacy.partition.network_state is set to true - part 1 - check the return value of GetUsername(), r=valentin,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D75984
This commit is contained in:
Родитель
449dbae8b1
Коммит
ab5b80165e
|
@ -10,6 +10,7 @@
|
|||
#include "HttpLog.h"
|
||||
#include "AltServiceChild.h"
|
||||
#include "mozilla/StaticPrefs_network.h"
|
||||
#include "mozilla/Unused.h"
|
||||
#include "nsDNSPrefetch.h"
|
||||
#include "nsEscape.h"
|
||||
#include "nsHttpTransaction.h"
|
||||
|
@ -303,12 +304,14 @@ nsresult TRRServiceChannel::BeginConnect() {
|
|||
rv = mURI->GetScheme(scheme);
|
||||
if (NS_SUCCEEDED(rv)) rv = mURI->GetAsciiHost(host);
|
||||
if (NS_SUCCEEDED(rv)) rv = mURI->GetPort(&port);
|
||||
if (NS_SUCCEEDED(rv)) mURI->GetUsername(mUsername);
|
||||
if (NS_SUCCEEDED(rv)) rv = mURI->GetAsciiSpec(mSpec);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
// Just a warning here because some nsIURIs do not implement this method.
|
||||
Unused << NS_WARN_IF(NS_FAILED(mURI->GetUsername(mUsername)));
|
||||
|
||||
// Reject the URL if it doesn't specify a host
|
||||
if (host.IsEmpty()) {
|
||||
rv = NS_ERROR_MALFORMED_URI;
|
||||
|
|
|
@ -6740,12 +6740,14 @@ nsresult nsHttpChannel::BeginConnect() {
|
|||
rv = mURI->GetScheme(scheme);
|
||||
if (NS_SUCCEEDED(rv)) rv = mURI->GetAsciiHost(host);
|
||||
if (NS_SUCCEEDED(rv)) rv = mURI->GetPort(&port);
|
||||
if (NS_SUCCEEDED(rv)) mURI->GetUsername(mUsername);
|
||||
if (NS_SUCCEEDED(rv)) rv = mURI->GetAsciiSpec(mSpec);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
// Just a warning here because some nsIURIs do not implement this method.
|
||||
Unused << NS_WARN_IF(NS_FAILED(mURI->GetUsername(mUsername)));
|
||||
|
||||
// Reject the URL if it doesn't specify a host
|
||||
if (host.IsEmpty()) {
|
||||
rv = NS_ERROR_MALFORMED_URI;
|
||||
|
|
Загрузка…
Ссылка в новой задаче