mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-24 06:59:52 +01:00
Merge branch 'develop' into py3
This commit is contained in:
commit
bb806d7f26
@ -1,4 +1,4 @@
|
|||||||
PyWb 0.11.1
|
PyWb 0.11.2
|
||||||
===========
|
===========
|
||||||
|
|
||||||
.. image:: https://travis-ci.org/ikreymer/pywb.svg?branch=master
|
.. image:: https://travis-ci.org/ikreymer/pywb.svg?branch=master
|
||||||
|
@ -297,6 +297,8 @@ class HTMLRewriterMixin(object):
|
|||||||
elif (tag == 'meta') and (attr_name == 'content'):
|
elif (tag == 'meta') and (attr_name == 'content'):
|
||||||
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)
|
||||||
|
elif attr_value.startswith(self.DATA_RW_PROTOCOLS):
|
||||||
|
attr_value = self._rewrite_url(attr_value, rw_mod)
|
||||||
|
|
||||||
# special case: param value, conditional rewrite
|
# special case: param value, conditional rewrite
|
||||||
elif (tag == 'param'):
|
elif (tag == 'param'):
|
||||||
|
@ -244,8 +244,9 @@ class RewriteContent:
|
|||||||
if m:
|
if m:
|
||||||
charset = m.group(1)
|
charset = m.group(1)
|
||||||
charset = to_native_str(charset)
|
charset = to_native_str(charset)
|
||||||
content_type = 'text/html; charset=' + charset
|
# content_type = 'text/html; charset=' + charset
|
||||||
status_headers.replace_header('content-type', content_type)
|
# status_headers.replace_header('content-type', content_type)
|
||||||
|
|
||||||
return charset
|
return charset
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
@ -94,6 +94,12 @@ r"""
|
|||||||
>>> parse('<META http-equiv="refresh" content>')
|
>>> parse('<META http-equiv="refresh" content>')
|
||||||
<meta http-equiv="refresh" content="">
|
<meta http-equiv="refresh" content="">
|
||||||
|
|
||||||
|
>>> parse('<meta property="og:image" content="http://example.com/example.jpg">')
|
||||||
|
<meta property="og:image" content="/web/20131226101010/http://example.com/example.jpg">
|
||||||
|
|
||||||
|
>>> parse('<meta property="og:image" content="example.jpg">')
|
||||||
|
<meta property="og:image" content="example.jpg">
|
||||||
|
|
||||||
# Custom -data attribs
|
# Custom -data attribs
|
||||||
>>> parse('<div data-url="http://example.com/a/b/c.html" data-some-other-value="http://example.com/img.gif">')
|
>>> parse('<div data-url="http://example.com/a/b/c.html" data-some-other-value="http://example.com/img.gif">')
|
||||||
<div data-url="/web/20131226101010oe_/http://example.com/a/b/c.html" data-some-other-value="/web/20131226101010oe_/http://example.com/img.gif">
|
<div data-url="/web/20131226101010oe_/http://example.com/a/b/c.html" data-some-other-value="/web/20131226101010oe_/http://example.com/img.gif">
|
||||||
|
@ -209,7 +209,7 @@ def test_example_1():
|
|||||||
|
|
||||||
|
|
||||||
# verify utf-8 charset detection
|
# verify utf-8 charset detection
|
||||||
assert status_headers.get_header('content-type') == 'text/html; charset=utf-8'
|
assert status_headers.get_header('content-type') == 'text/html'
|
||||||
|
|
||||||
assert '/pywb/20131226101010/http://www.iana.org/domains/example' in buff, buff
|
assert '/pywb/20131226101010/http://www.iana.org/domains/example' in buff, buff
|
||||||
|
|
||||||
|
@ -63,8 +63,12 @@ this.create_banner_element = function() {
|
|||||||
|
|
||||||
this.ts_to_date = function(ts, is_gmt)
|
this.ts_to_date = function(ts, is_gmt)
|
||||||
{
|
{
|
||||||
|
if (!ts) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
if (ts.length < 14) {
|
if (ts.length < 14) {
|
||||||
return ts;
|
ts += "00000000000000".substr(ts.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
var datestr = (ts.substring(0, 4) + "-" +
|
var datestr = (ts.substring(0, 4) + "-" +
|
||||||
|
@ -108,7 +108,7 @@ class SearchPageWbUrlHandler(WbUrlHandler):
|
|||||||
def get_top_frame_response(self, wbrequest):
|
def get_top_frame_response(self, wbrequest):
|
||||||
params = self.get_top_frame_params(wbrequest, mod=self.replay_mod)
|
params = self.get_top_frame_params(wbrequest, mod=self.replay_mod)
|
||||||
|
|
||||||
headers = [('Content-Type', 'text/html; charset=utf-8')]
|
headers = [('Content-Type', 'text/html')]
|
||||||
status_headers = StatusAndHeaders('200 OK', headers)
|
status_headers = StatusAndHeaders('200 OK', headers)
|
||||||
|
|
||||||
template_result = self.frame_insert_view.render_to_string(**params)
|
template_result = self.frame_insert_view.render_to_string(**params)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user