1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-15 00:03:28 +01:00

dockerfile: add portalocker

rewriterapp: don't add memento headers for ajax responses to avoid replay issues
This commit is contained in:
Ilya Kreymer 2017-03-08 12:30:20 -08:00
parent 114ef2a637
commit a2ffbde2f6
2 changed files with 7 additions and 6 deletions

View File

@ -8,7 +8,7 @@ COPY uwsgi.ini /uwsgi/
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 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
ADD . /pywb

View File

@ -209,7 +209,8 @@ class RewriterApp(object):
except (ValueError, TypeError):
pass
if self.is_ajax(environ):
is_ajax = self.is_ajax(environ)
if is_ajax:
head_insert_func = None
urlrewriter.rewrite_opts['is_ajax'] = True
else:
@ -244,11 +245,11 @@ class RewriterApp(object):
if ' ' not in status_headers.statusline:
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'],
url=cdx['url'])))
status_headers.headers.append(('Content-Location', urlrewriter.get_new_url(timestamp=cdx['timestamp'],
url=cdx['url'])))
#gen = buffer_iter(status_headers, gen)