mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-24 06:59:52 +01:00
dockerfile: add portalocker
rewriterapp: don't add memento headers for ajax responses to avoid replay issues
This commit is contained in:
parent
114ef2a637
commit
a2ffbde2f6
@ -8,7 +8,7 @@ COPY uwsgi.ini /uwsgi/
|
|||||||
RUN pip install gevent==1.1.2 certauth youtube-dl boto uwsgi urllib3
|
RUN pip install gevent==1.1.2 certauth youtube-dl boto uwsgi urllib3
|
||||||
RUN pip install git+https://github.com/t0m/pyamf.git@python3
|
RUN pip install git+https://github.com/t0m/pyamf.git@python3
|
||||||
RUN pip install webassets pyyaml brotlipy
|
RUN pip install webassets pyyaml brotlipy
|
||||||
RUN pip install six chardet 'requests<2.12' redis jinja2 'surt>=0.3.0' webencodings
|
RUN pip install six chardet 'requests<2.12' redis jinja2 'surt>=0.3.0' webencodings portalocker
|
||||||
|
|
||||||
RUN mkdir /pywb
|
RUN mkdir /pywb
|
||||||
ADD . /pywb
|
ADD . /pywb
|
||||||
|
@ -209,7 +209,8 @@ class RewriterApp(object):
|
|||||||
except (ValueError, TypeError):
|
except (ValueError, TypeError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if self.is_ajax(environ):
|
is_ajax = self.is_ajax(environ)
|
||||||
|
if is_ajax:
|
||||||
head_insert_func = None
|
head_insert_func = None
|
||||||
urlrewriter.rewrite_opts['is_ajax'] = True
|
urlrewriter.rewrite_opts['is_ajax'] = True
|
||||||
else:
|
else:
|
||||||
@ -244,11 +245,11 @@ class RewriterApp(object):
|
|||||||
if ' ' not in status_headers.statusline:
|
if ' ' not in status_headers.statusline:
|
||||||
status_headers.statusline += ' None'
|
status_headers.statusline += ' None'
|
||||||
|
|
||||||
self._add_memento_links(urlrewriter, full_prefix, memento_dt, status_headers)
|
if not is_ajax:
|
||||||
|
self._add_memento_links(urlrewriter, full_prefix, memento_dt, status_headers)
|
||||||
|
|
||||||
#if cdx['timestamp'] != wb_url.timestamp:
|
status_headers.headers.append(('Content-Location', urlrewriter.get_new_url(timestamp=cdx['timestamp'],
|
||||||
status_headers.headers.append(('Content-Location', urlrewriter.get_new_url(timestamp=cdx['timestamp'],
|
url=cdx['url'])))
|
||||||
url=cdx['url'])))
|
|
||||||
|
|
||||||
#gen = buffer_iter(status_headers, gen)
|
#gen = buffer_iter(status_headers, gen)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user