зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1153896 - dont setup altsvc for same host/port as origin r=hurley
This commit is contained in:
Родитель
c5a3235e9e
Коммит
61b076171b
|
@ -109,7 +109,15 @@ AltSvcMapping::ProcessHeader(const nsCString &buf, const nsCString &originScheme
|
|||
username, privateBrowsing,
|
||||
NowInSeconds() + maxage,
|
||||
hostname, portno, npnToken);
|
||||
gHttpHandler->UpdateAltServiceMapping(mapping, proxyInfo, callbacks, caps);
|
||||
if (mapping->TTL() <= 0) {
|
||||
LOG(("Alt Svc invalid map"));
|
||||
mapping = nullptr;
|
||||
// since this isn't a parse error, let's clear any existing mapping
|
||||
// as that would have happened if we had accepted the parameters.
|
||||
gHttpHandler->ConnMgr()->ClearHostMapping(originHost, originPort);
|
||||
} else {
|
||||
gHttpHandler->UpdateAltServiceMapping(mapping, proxyInfo, callbacks, caps);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -153,6 +161,12 @@ AltSvcMapping::AltSvcMapping(const nsACString &originScheme,
|
|||
mAlternateHost = mOriginHost;
|
||||
}
|
||||
|
||||
if ((mAlternatePort == mOriginPort) &&
|
||||
mAlternateHost.EqualsIgnoreCase(mOriginHost.get())) {
|
||||
LOG(("Alt Svc is also origin Svc - ignoring\n"));
|
||||
mExpiresAt = 0; // invalid
|
||||
}
|
||||
|
||||
if (mExpiresAt) {
|
||||
MakeHashKey(mHashKey, originScheme, mOriginHost, mOriginPort, mPrivate);
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ class AltSvcMapping
|
|||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(AltSvcMapping)
|
||||
friend class AltSvcCache;
|
||||
|
||||
public:
|
||||
private: // ctor from ProcessHeader
|
||||
AltSvcMapping(const nsACString &originScheme,
|
||||
const nsACString &originHost,
|
||||
int32_t originPort,
|
||||
|
@ -49,6 +49,7 @@ public:
|
|||
int32_t alternatePort,
|
||||
const nsACString &npnToken);
|
||||
|
||||
public:
|
||||
static void ProcessHeader(const nsCString &buf, const nsCString &originScheme,
|
||||
const nsCString &originHost, int32_t originPort,
|
||||
const nsACString &username, bool privateBrowsing,
|
||||
|
|
Загрузка…
Ссылка в новой задаче