mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 13:34:03 +00:00
partly import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1172080 - Part 2: Use ^ instead of ! to delimit originAttributes from the URI in nsIPrincipal.origin, r=bholley (929ef38df)
This commit is contained in:
@@ -51,7 +51,7 @@ OriginAttributes::CreateSuffix(nsACString& aStr) const
|
||||
|
||||
params->Serialize(value);
|
||||
if (!value.IsEmpty()) {
|
||||
aStr.AppendLiteral("!");
|
||||
aStr.AppendLiteral("^");
|
||||
aStr.Append(NS_ConvertUTF16toUTF8(value));
|
||||
}
|
||||
}
|
||||
@@ -117,7 +117,7 @@ OriginAttributes::PopulateFromSuffix(const nsACString& aStr)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (aStr[0] != '!') {
|
||||
if (aStr[0] != '^') {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ OriginAttributes::PopulateFromOrigin(const nsACString& aOrigin,
|
||||
{
|
||||
// RFindChar is only available on nsCString.
|
||||
nsCString origin(aOrigin);
|
||||
int32_t pos = origin.RFindChar('!');
|
||||
int32_t pos = origin.RFindChar('^');
|
||||
|
||||
if (pos == kNotFound) {
|
||||
aOriginNoSuffix = origin;
|
||||
|
||||
@@ -51,7 +51,7 @@ add_test(() => {
|
||||
});
|
||||
|
||||
Assert.ok(mozapp.principal, "app principal should exist");
|
||||
let expectedPrincipalOrigin = app.origin + "!appId=" + app.localId;
|
||||
let expectedPrincipalOrigin = app.origin + "^appId=" + app.localId;
|
||||
Assert.equal(mozapp.principal.origin, expectedPrincipalOrigin,
|
||||
"app principal origin ok");
|
||||
Assert.equal(mozapp.principal.appId, app.localId, "app principal appId ok");
|
||||
|
||||
@@ -115,7 +115,7 @@ this.BrowserUtils = {
|
||||
throw new Error("principalFromOrigin does not support nsNullPrincipal");
|
||||
}
|
||||
|
||||
var parts = aOriginString.split('!');
|
||||
var parts = aOriginString.split('^');
|
||||
if (parts.length > 2) {
|
||||
throw new Error("bad origin string: " + aOriginString);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user