Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
Automated g4 rollback of changelist 264626714.
Browse files Browse the repository at this point in the history
*** Reason for rollback ***

This breaks instances in report-only Trusted-Types enforcement, where non-TrustedURL types are passed to the sinks.

w3c/trusted-types#209

*** Original change description ***

Make Closure Trusted Types integration not require TrustedURL values, as they will soon be removed from the Trusted Types API - w3c/trusted-types#204.

goog.createTrustedTypesPolicy will attempt to create a default policy allowing any value to be converted to TrustedURL.

RELNOTES: Trusted Types integrations will allow any value to be a TrustedURL via defensively creating a 'default' policy (to prepare for TrustedURL deprecation)

***

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=265699886
  • Loading branch information
koto authored and shicks committed Aug 30, 2019
1 parent 1bcb6b0 commit f1a89b3
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions closure/goog/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -4170,21 +4170,6 @@ goog.createTrustedTypesPolicy = function(name) {
} catch (e) {
goog.logToConsole_(e.message);
}

// TrustedTypes API will deprecate TrustedURLs in Chrome 78. To prepare for
// that, and make the Closure code emulate the post-deprecation behavior
// of the API, we attempt to create a default policy that blesses any value
// to TrustedURL. This is a best-effort attempt. If that does not succeed,
// the application fails close - TrustedURL values will simply be required
// at all relevant sinks.
if (goog.global.TrustedURL && policyFactory.getPolicyNames &&
policyFactory.getPolicyNames().indexOf('default') === -1) {
try {
policyFactory.createPolicy('default', {createURL: goog.identity_}, true);
} catch (e) {
goog.logToConsole_(e.message);
}
}
return policy;
};

Expand Down

0 comments on commit f1a89b3

Please sign in to comment.