mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-24 06:59:52 +01:00
html rewrite: rewrite param value only if start with http
This commit is contained in:
parent
3e3a74619f
commit
87d791eba8
@ -43,6 +43,7 @@ class HTMLRewriterMixin(object):
|
|||||||
'meta': {'content': defmod},
|
'meta': {'content': defmod},
|
||||||
'object': {'codebase': 'oe_',
|
'object': {'codebase': 'oe_',
|
||||||
'data': 'oe_'},
|
'data': 'oe_'},
|
||||||
|
'param': {'value': 'oe_'},
|
||||||
'q': {'cite': defmod},
|
'q': {'cite': defmod},
|
||||||
'ref': {'href': 'oe_'},
|
'ref': {'href': 'oe_'},
|
||||||
'script': {'src': 'js_'},
|
'script': {'src': 'js_'},
|
||||||
@ -196,7 +197,13 @@ class HTMLRewriterMixin(object):
|
|||||||
if self.has_attr(tag_attrs, ('http-equiv', 'refresh')):
|
if self.has_attr(tag_attrs, ('http-equiv', 'refresh')):
|
||||||
attr_value = self._rewrite_meta_refresh(attr_value)
|
attr_value = self._rewrite_meta_refresh(attr_value)
|
||||||
|
|
||||||
# special case: data- attrs
|
# special case: param value, conditional rewrite
|
||||||
|
elif (tag == 'param'):
|
||||||
|
if attr_value.startswith(self.DATA_RW_PROTOCOLS):
|
||||||
|
rw_mod = handler.get(attr_name)
|
||||||
|
attr_value = self._rewrite_url(attr_value, rw_mod)
|
||||||
|
|
||||||
|
# special case: data- attrs, conditional rewrite
|
||||||
elif attr_name and attr_value and attr_name.startswith('data-'):
|
elif attr_name and attr_value and attr_name.startswith('data-'):
|
||||||
if attr_value.startswith(self.DATA_RW_PROTOCOLS):
|
if attr_value.startswith(self.DATA_RW_PROTOCOLS):
|
||||||
rw_mod = 'oe_'
|
rw_mod = 'oe_'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user