Allow uncompressed GPX traces to be fetched from the API
This commit is contained in:
parent
232337c08b
commit
2ce394118d
2 changed files with 6 additions and 1 deletions
|
@ -292,7 +292,11 @@ class TraceController < ApplicationController
|
|||
trace = Trace.find(params[:id])
|
||||
|
||||
if trace.public? or trace.user == @user
|
||||
send_file(trace.trace_name, :filename => "#{trace.id}#{trace.extension_name}", :type => trace.mime_type, :disposition => 'attachment')
|
||||
if request.format == Mime::XML
|
||||
send_file(trace.xml_file, :filename => "#{trace.id}.xml", :type => Mime::XML.to_s, :disposition => 'attachment')
|
||||
else
|
||||
send_file(trace.trace_name, :filename => "#{trace.id}#{trace.extension_name}", :type => trace.mime_type, :disposition => 'attachment')
|
||||
end
|
||||
else
|
||||
render :nothing => true, :status => :forbidden
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue