Skip to content

Commit

Permalink
Set downloadURL none for specific version requests
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonBarnabe committed Feb 17, 2018
1 parent 3298317 commit a197bcc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/controllers/scripts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,11 @@ def user_js

user_js_code = script.script_delete_type_id == 2 ? script_version.get_blanked_code : script_version.rewritten_code

# If the request specifies a specific version, the code will never change, so inform the manager not to check for updates.
if params[:version].present?
user_js_code = ScriptVersion.inject_meta_for_code(user_js_code, downloadURL: 'none')
end

File.write(cache_path, user_js_code) if do_caching

render body: user_js_code, content_type: 'text/javascript'
Expand Down

0 comments on commit a197bcc

Please sign in to comment.