diff --git a/etc/nginx/pandora b/etc/nginx/pandora index 8ef1f433..419120aa 100644 --- a/etc/nginx/pandora +++ b/etc/nginx/pandora @@ -55,11 +55,11 @@ server { proxy_buffering off; proxy_read_timeout 90; #should be in sync with gunicorn timeout proxy_connect_timeout 90; #should be in sync with gunicorn timeout + client_max_body_size 32m; if (!-f $request_filename) { proxy_pass http://127.0.0.1:2620; break; } - client_max_body_size 32m; } error_page 400 /; diff --git a/pandora/manage.py b/pandora/manage.py index d33da6f9..700a1802 100755 --- a/pandora/manage.py +++ b/pandora/manage.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import os import signal import sys diff --git a/static/js/document.js b/static/js/document.js index 6d1b2567..a13332d2 100644 --- a/static/js/document.js +++ b/static/js/document.js @@ -66,7 +66,7 @@ pandora.ui.document = function() { ? pandora.user.ui.documents[item.id].position : 1, url: '/documents/' + item.id + '/' - + item.title.replace('?', '_') + '.' + item.extension, + + pandora.safePDFName(item.title + '.' + item.extension), width: that.width(), zoom: 'fit' }) diff --git a/static/js/documentDialog.js b/static/js/documentDialog.js index a8d1d581..b2c17308 100644 --- a/static/js/documentDialog.js +++ b/static/js/documentDialog.js @@ -196,7 +196,7 @@ pandora.ui.documentDialog = function(options) { ? pandora.user.ui.documents[item.id].position : 1, url: '/documents/' + item.id + '/' - + item.title.replace('?', '_') + '.' + item.extension, + + pandora.safePDFName(item.title + '.' + item.extension), width: dialogWidth, zoom: 'fit' }) diff --git a/static/js/utils.js b/static/js/utils.js index 7f80064d..3ce86c15 100644 --- a/static/js/utils.js +++ b/static/js/utils.js @@ -2625,6 +2625,11 @@ pandora.openURL = function(url) { } }; +pandora.safePDFName = function(name) { + name = name.replace('?', '_').replace('#', '_'); + return name; +}; + pandora.saveURL = function(url, name) { var link = document.createElement('a'); if (typeof link.download === 'string') { diff --git a/update.py b/update.py index 119f9adb..0e6c04de 100755 --- a/update.py +++ b/update.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function import json import os