Skip to content

Commit

Permalink
Transplants the fix for Rack > 2.0.7 breaking uploads from ef0b230
Browse files Browse the repository at this point in the history
  • Loading branch information
kirichkov committed Feb 20, 2020
1 parent f0b2087 commit caa4eb5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/views/comfy/admin/cms/files/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@

= comfy_paginate @files

:ruby
session_id = request.session_options[:id]
session_id_value = session_id.respond_to?(:public_id) ? session_id.public_id : session_id.to_s

:javascript
$(function(){
window.CMS.uploader($("#cms-uploader"), {
url: '#{comfy_admin_cms_site_files_path(@site, :source => :plupload, :category => params[:category])}',
multipart_params: {
'#{request_forgery_protection_token}': '#{form_authenticity_token}',
'#{Rails.application.config.session_options[:key]}': '#{request.session_options[:id]}'
'#{Rails.application.config.session_options[:key]}': '#{session_id_value}'
}
});
});

0 comments on commit caa4eb5

Please sign in to comment.