[sagenb] 122/157: Cache bust for jsmol (including on Chrome)

felix salfelder felix-guest at moszumanska.debian.org
Mon Dec 22 16:51:59 UTC 2014


This is an automated email from the git hooks/post-receive script.

felix-guest pushed a commit to branch master
in repository sagenb.

commit 4636610c9555d8eb747af7ee6d9489193035e996
Author: Karl-Dieter Crisman <kcrisman at gmail.com>
Date:   Wed Oct 22 09:22:26 2014 -0400

    Cache bust for jsmol (including on Chrome)
---
 sagenb/flask_version/worksheet.py | 1 +
 sagenb/notebook/cell.py           | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/sagenb/flask_version/worksheet.py b/sagenb/flask_version/worksheet.py
index 40c3d54..fd0dcf2 100644
--- a/sagenb/flask_version/worksheet.py
+++ b/sagenb/flask_version/worksheet.py
@@ -695,6 +695,7 @@ def worksheet_jsmol_data(worksheet):
             return current_app.message(_('Invalid JSmol query: ' + query))
         cell_id = match.group('cell_id')
         filename = match.group('filename')
+        filename = filename.rsplit('?',1)[0] # appended query is only for cache busting
         filename = secure_filename(filename)   # never trust input
         filename = os.path.join(worksheet.cells_directory(), cell_id, filename)
         with open(filename, 'r') as f:
diff --git a/sagenb/notebook/cell.py b/sagenb/notebook/cell.py
index 7c322c9..d0ce526 100755
--- a/sagenb/notebook/cell.py
+++ b/sagenb/notebook/cell.py
@@ -2350,7 +2350,7 @@ class Cell(Cell_generic):
             <div id="loadJmol" style="display:none;">{id}</div>
             <div id="sage_jmol_size_{id}" style="display:none;">{size}</div>
             <div id="sage_jmol_img_{id}" style="display:none;">{image_name}.png?{timestamp}</div>
-            <div id="sage_jmol_script_{id}" style="display:none;">{filename}</div>
+            <div id="sage_jmol_script_{id}" style="display:none;">{filename}?{timestamp}</div>
             <div id="sage_jmol_server_url_{id}" style="display:none;">{callback}</div>
             <div id="sage_jmol_status_{id}" style="display:none;">notActivated</div>
         </div>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/sagenb.git



More information about the debian-science-commits mailing list