Skip to content

Commit

Permalink
fix #2644 by never caching the files controllers' json response (#2645)
Browse files Browse the repository at this point in the history
  • Loading branch information
johrstrom authored Mar 8, 2023
1 parent 74b79f1 commit c90e8ea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions apps/dashboard/app/controllers/files_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def fs
end

format.json do
response.headers['Cache-Control'] = 'no-store'
if params[:can_download]
# check to see if this directory can be downloaded as a zip
can_download, error_message = @path.can_download_as_zip?
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/app/javascript/packs/files/data_table.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ class DataTable {
var request_url = url || history.state.currentDirectoryUrl;

try {
const response = await fetch(request_url, { headers: { 'Accept': 'application/json' } });
const response = await fetch(request_url, { headers: { 'Accept': 'application/json' }, cache: 'no-store' });
const data = await this.dataFromJsonResponse(response);
history.state.currentFilenames = Array.from(data.files, x => x.name);
$('#shell-wrapper').replaceWith((data.shell_dropdown_html));
Expand Down

0 comments on commit c90e8ea

Please sign in to comment.