зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1652655 - P1: Sort HTTPSSVC records, r=dragana,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D85121
This commit is contained in:
Родитель
c1e5ec87eb
Коммит
2e10bf25d7
|
@ -82,6 +82,9 @@ struct SVCB {
|
|||
mSvcDomainName == aOther.mSvcDomainName &&
|
||||
mSvcFieldValue == aOther.mSvcFieldValue;
|
||||
}
|
||||
bool operator<(const SVCB& aOther) const {
|
||||
return mSvcFieldPriority < aOther.mSvcFieldPriority;
|
||||
}
|
||||
uint16_t mSvcFieldPriority = 0;
|
||||
nsCString mSvcDomainName;
|
||||
CopyableTArray<SvcFieldValue> mSvcFieldValue;
|
||||
|
|
|
@ -1197,6 +1197,16 @@ nsresult TRR::DohDecode(nsCString& aHost) {
|
|||
LOG(("TRR: No entries were stored!\n"));
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
// https://tools.ietf.org/html/draft-ietf-dnsop-svcb-httpssvc-03#page-14
|
||||
// If one or more SVCB records of ServiceForm SvcRecordType are returned for
|
||||
// HOST, clients should select the highest-priority option with acceptable
|
||||
// parameters.
|
||||
if (mResult.is<TypeRecordHTTPSSVC>()) {
|
||||
auto& results = mResult.as<TypeRecordHTTPSSVC>();
|
||||
results.Sort();
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче