File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
apps/dashboard/app/controllers Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -46,13 +46,18 @@ def icon
4646 set_app
4747 expires_in 365 . days , public : true
4848
49- if @app . svg_icon?
50- send_file @app . icon_path , :type => 'image/svg+xml' , :disposition => 'inline'
49+ if @app . svg_icon?
50+ content_type = 'image/svg+xml'
51+ dispostion_header = 'inline; filename="icon.svg"; filename*=UTF-8\'\'icon.svg'
5152 elsif @app . png_icon?
52- send_file @app . icon_path , :type => 'image/png' , :disposition => 'inline'
53+ content_type = 'image/png'
54+ dispostion_header = 'inline; filename="icon.png"; filename*=UTF-8\'\'icon.png'
5355 else
54- raise ActionController ::RoutingError . new ( 'Not Found' )
56+ raise ( ActionController ::RoutingError , 'Not Found' )
5557 end
58+
59+ response . headers [ 'content-disposition' ] = dispostion_header
60+ render ( file : @app . icon_path , layout : false , content_type : content_type )
5661 end
5762
5863 private
You can’t perform that action at this time.
0 commit comments