mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-15 00:03:28 +01:00
static path prefix fix to support non-root pywb deployment:
- store original wsgi SCRIPT_NAME (before collection path is pushed) - add 'static_prefix' jinja env global which defaults to original prefix + /static/ - update existing templates to use '{{ static_prefix }}' instead of '{{ host_prefix }}/{{ static_path }'' - set 'pywb.host_prefix' via rewriterapp, set 'static_prefix' to absolute url if available (to support proxy mode)
This commit is contained in:
parent
af3e9c6293
commit
465195f203
@ -494,6 +494,9 @@ class FrontEndApp(object):
|
||||
# store original script_name (original prefix) before modifications are made
|
||||
environ['pywb.app_prefix'] = environ.get('SCRIPT_NAME', '')
|
||||
|
||||
# store original script_name (original prefix) before modifications are made
|
||||
environ['ORIG_SCRIPT_NAME'] = environ.get('SCRIPT_NAME')
|
||||
|
||||
lang = args.pop('lang', '')
|
||||
if lang:
|
||||
pop_path_info(environ)
|
||||
|
@ -267,6 +267,8 @@ class RewriterApp(object):
|
||||
'pywb.static_prefix', '/static/')
|
||||
is_proxy = ('wsgiprox.proxy_host' in environ)
|
||||
|
||||
environ['pywb.host_prefix'] = host_prefix
|
||||
|
||||
if self.use_js_obj_proxy:
|
||||
content_rw = self.js_proxy_rw
|
||||
else:
|
||||
|
@ -3,7 +3,7 @@
|
||||
{% set urlsplit = cdx.url | urlsplit %}
|
||||
wbinfo = {};
|
||||
wbinfo.top_url = "{{ top_url }}";
|
||||
{% if is_framed %}
|
||||
{% if is_framed == 'true' %}
|
||||
// Fast Top-Frame Redirect
|
||||
if (window == window.top && wbinfo.top_url) {
|
||||
var loc = window.location.href.replace(window.location.hash, "");
|
||||
|
Loading…
x
Reference in New Issue
Block a user