Bug 1527236 - Allow % in URLs for Thunderbird. r=valentin

This commit is contained in:
Jorg K 2019-02-12 18:43:30 +01:00
Родитель e410929cbc
Коммит 15ee3d3e8f
3 изменённых файлов: 13 добавлений и 3 удалений

Просмотреть файл

@ -69,7 +69,12 @@ constexpr bool TestForInvalidHostCharacters(char c) {
return (c > 0 && c < 32) || // The control characters are [1, 31]
c == ' ' || c == '#' || c == '/' || c == ':' || c == '?' || c == '@' ||
c == '[' || c == '\\' || c == ']' || c == '*' || c == '<' ||
#if defined(MOZ_THUNDERBIRD) || defined(MOZ_SUITE)
// Mailnews %-escapes file paths into URLs.
c == '>' || c == '|' || c == '"';
#else
c == '>' || c == '|' || c == '"' || c == '%';
#endif
}
constexpr ASCIIMaskArray sInvalidHostChars =
CreateASCIIMask(TestForInvalidHostCharacters);

Просмотреть файл

@ -1,6 +1,7 @@
"use strict";
ChromeUtils.import('resource://gre/modules/Services.jsm');
var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
var {AppConstants} = ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
const gPrefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
function symmetricEquality(expect, a, b)
@ -308,7 +309,8 @@ add_test(function test_accentEncoding()
run_next_test();
});
add_test(function test_percentDecoding()
add_test({ skip_if: () => AppConstants.MOZ_APP_NAME == "thunderbird" },
function test_percentDecoding()
{
var url = stringToURL("http://%70%61%73%74%65%62%69%6E.com");
Assert.equal(url.spec, "http://pastebin.com/");
@ -698,7 +700,8 @@ add_test(function test_idna_host() {
run_next_test();
});
add_test(function test_bug1517025() {
add_test({ skip_if: () => AppConstants.MOZ_APP_NAME == "thunderbird" },
function test_bug1517025() {
Assert.throws(() => { let other = stringToURL("https://b%9a/"); },
/NS_ERROR_UNEXPECTED/, "bad URI");

Просмотреть файл

@ -382,7 +382,9 @@ skip-if = os == "android"
[test_cookie_blacklist.js]
[test_getHost.js]
[test_bug412457.js]
skip-if = appname == "thunderbird"
[test_bug464591.js]
skip-if = appname == "thunderbird"
[test_alt-data_simple.js]
[test_alt-data_stream.js]
[test_alt-data_too_big.js]