🌐 AI搜索 & 代理 主页
Skip to content

Commit e4757eb

Browse files
authored
Allow data: to not be part of sanitizer’s allowed protocols
When `data:` wasn’t permitted, it could attempt to `del attrs[attr]` twice.
1 parent 4f92357 commit e4757eb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

html5lib/filters/sanitizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ def allowed_token(self, token):
825825
if uri and uri.scheme:
826826
if uri.scheme not in self.allowed_protocols:
827827
del attrs[attr]
828-
if uri.scheme == 'data':
828+
elif uri.scheme == 'data':
829829
m = data_content_type.match(uri.path)
830830
if not m:
831831
del attrs[attr]

0 commit comments

Comments
 (0)