diff --git a/packages/@glimmer-workspace/integration-tests/test/attributes-test.ts b/packages/@glimmer-workspace/integration-tests/test/attributes-test.ts
index eef13f25c13..36e53723e1b 100644
--- a/packages/@glimmer-workspace/integration-tests/test/attributes-test.ts
+++ b/packages/@glimmer-workspace/integration-tests/test/attributes-test.ts
@@ -573,6 +573,18 @@ export class AttributesTests extends RenderTest {
this.assertHTML('');
this.assertStableNodes();
}
+
+ @test
+ 'sanitizes url attributes regardless of attribute name case'() {
+ this.render('', { foo: 'javascript:foo()' });
+ this.assertHTML('');
+
+ this.rerender({ foo: 'http://foo.bar' });
+ this.assertHTML('');
+
+ this.rerender({ foo: 'javascript:foo()' });
+ this.assertHTML('');
+ }
}
jitSuite(AttributesTests);
diff --git a/packages/@glimmer/runtime/lib/dom/sanitized-values.ts b/packages/@glimmer/runtime/lib/dom/sanitized-values.ts
index a5203749453..f5f0e16685d 100644
--- a/packages/@glimmer/runtime/lib/dom/sanitized-values.ts
+++ b/packages/@glimmer/runtime/lib/dom/sanitized-values.ts
@@ -17,12 +17,12 @@ function has(array: Array, item: string): boolean {
}
function checkURI(tagName: Nullable, attribute: string): boolean {
- return (tagName === null || has(badTags, tagName)) && has(badAttributes, attribute);
+ return (tagName === null || has(badTags, tagName)) && has(badAttributes, attribute.toLowerCase());
}
function checkDataURI(tagName: Nullable, attribute: string): boolean {
if (tagName === null) return false;
- return has(badTagsForDataURI, tagName) && has(badAttributesForDataURI, attribute);
+ return has(badTagsForDataURI, tagName) && has(badAttributesForDataURI, attribute.toLowerCase());
}
export function requiresSanitization(tagName: string, attribute: string): boolean {