Skip to content

Commit 1ec7d95

Browse files
authored
Bugifx: Allow all policies in the enforcing polyfill if trusted-types directive is missing. (#249)
1 parent 6dbf0bf commit 1ec7d95

File tree

6 files changed

+63
-58
lines changed

6 files changed

+63
-58
lines changed

dist/es5/trustedtypes.build.js

Lines changed: 29 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/es5/trustedtypes.build.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/es6/trustedtypes.build.js

Lines changed: 23 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/es6/trustedtypes.build.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/spec/index.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,8 +1212,9 @@
12121212
}
12131213
}
12141214
</style>
1215-
<meta content="Bikeshed version e1a165f1c2fb1cc2aceb87e110984a42830c36fa" name="generator">
1215+
<meta content="Bikeshed version 0dd2bba6dfda6c3168490a3a3044dd1d0b1ef8e0" name="generator">
12161216
<link href="https://w3c.github.io/webappsec-trusted-types/dist/spec/" rel="canonical">
1217+
<meta content="6dbf0bff11eac270d02fcdc03fc44d0c36ef71cf" name="document-revision">
12171218
<style>/* style-md-lists */
12181219

12191220
/* This is a weird hack for me not yet following the commonmark spec
@@ -1460,7 +1461,7 @@
14601461
<div class="head">
14611462
<p data-fill-with="logo"><a class="logo" href="https://www.w3.org/"> <img alt="W3C" height="48" src="https://www.w3.org/StyleSheets/TR/2016/logos/W3C" width="72"> </a> </p>
14621463
<h1 class="p-name no-ref" id="title">Trusted Types</h1>
1463-
<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Editor’s Draft, <time class="dt-updated" datetime="2019-12-02">2 December 2019</time></span></h2>
1464+
<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Editor’s Draft, <time class="dt-updated" datetime="2019-12-03">3 December 2019</time></span></h2>
14641465
<div data-fill-with="spec-metadata">
14651466
<dl>
14661467
<dt>This version:

src/enforcer.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,12 @@ export class TrustedTypesEnforcer {
175175
*
176176
*/
177177
install() {
178-
setPolicyNameRestrictions(this.config_.allowedPolicyNames,
179-
this.config_.allowDuplicates);
178+
if (this.config_.allowedPolicyNames.includes('*')) {
179+
clearPolicyNameRestrictions();
180+
} else {
181+
setPolicyNameRestrictions(this.config_.allowedPolicyNames,
182+
this.config_.allowDuplicates);
183+
}
180184

181185
if (!this.config_.isEnforcementEnabled && !this.config_.isLoggingEnabled) {
182186
return;

0 commit comments

Comments
 (0)