зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1845552 - patch 2 - Don't return a malformed-URL error if the label is empty in StringPrepForDNS processing; just let the caller deal with that. r=necko-reviewers,valentin
Depends on D186866 Differential Revision: https://phabricator.services.mozilla.com/D186867
This commit is contained in:
Родитель
74bf676eba
Коммит
4507c87b9e
|
@ -197,15 +197,19 @@ nsresult nsIDNService::IDNA2008StringPrep(const nsAString& input,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
bool hasError = flag == eStringPrepForDNS
|
||||
? info.HasErrorsIgnoringInvalidHyphen()
|
||||
: info.HasErrors();
|
||||
|
||||
if (hasError) {
|
||||
if (flag == eStringPrepForDNS) {
|
||||
output.Truncate();
|
||||
if (flag == eStringPrepForDNS) {
|
||||
// We ignore errors if the result is empty, or if the errors were just
|
||||
// invalid hyphens (not punycode-decoding failure or invalid chars).
|
||||
if (!output.IsEmpty()) {
|
||||
if (info.HasErrorsIgnoringInvalidHyphen()) {
|
||||
output.Truncate();
|
||||
rv = NS_ERROR_MALFORMED_URI;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (info.HasErrors()) {
|
||||
rv = NS_ERROR_MALFORMED_URI;
|
||||
}
|
||||
rv = NS_ERROR_MALFORMED_URI;
|
||||
}
|
||||
|
||||
return rv;
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
[IdnaTestV2.window.html]
|
||||
[ToASCII("ä..c") A4_2 (ignored)]
|
||||
expected: FAIL
|
||||
|
||||
[ToASCII("ä..c") A4_2 (ignored)]
|
||||
expected: FAIL
|
||||
|
||||
[ToASCII("Ä..C") A4_2 (ignored)]
|
||||
expected: FAIL
|
||||
|
||||
[ToASCII("Ä..C") A4_2 (ignored)]
|
||||
expected: FAIL
|
||||
|
||||
[ToASCII("-𐋷𖾑。󠆬") V3 (ignored)]
|
||||
expected: FAIL
|
||||
|
||||
[ToASCII("︅。。𦀾᳠") A4_2 (ignored)]
|
||||
expected: FAIL
|
Загрузка…
Ссылка в новой задаче