Return GPX traces as application/gpx+xml instead of text/xml
This commit is contained in:
parent
ecf8c90e88
commit
7e896d758d
2 changed files with 5 additions and 5 deletions
|
@ -151,8 +151,8 @@ class TraceController < ApplicationController
|
|||
if trace.visible? and (trace.public? or (@user and @user == trace.user))
|
||||
if Acl.no_trace_download(request.remote_ip)
|
||||
render :text => "", :status => :forbidden
|
||||
elsif request.format == Mime::XML
|
||||
send_file(trace.xml_file, :filename => "#{trace.id}.xml", :type => Mime::XML.to_s, :disposition => 'attachment')
|
||||
elsif request.format == Mime::XML or request.format == Mime::GPX
|
||||
send_file(trace.xml_file, :filename => "#{trace.id}.xml", :type => request.format.to_s, :disposition => 'attachment')
|
||||
else
|
||||
send_file(trace.trace_name, :filename => "#{trace.id}#{trace.extension_name}", :type => trace.mime_type, :disposition => 'attachment')
|
||||
end
|
||||
|
@ -308,8 +308,8 @@ class TraceController < ApplicationController
|
|||
trace = Trace.find(params[:id])
|
||||
|
||||
if trace.public? or trace.user == @user
|
||||
if request.format == Mime::XML
|
||||
send_file(trace.xml_file, :filename => "#{trace.id}.xml", :type => Mime::XML.to_s, :disposition => 'attachment')
|
||||
if request.format == Mime::XML or request.format == Mime::GPX
|
||||
send_file(trace.xml_file, :filename => "#{trace.id}.xml", :type => request.format.to_s, :disposition => 'attachment')
|
||||
else
|
||||
send_file(trace.trace_name, :filename => "#{trace.id}#{trace.extension_name}", :type => trace.mime_type, :disposition => 'attachment')
|
||||
end
|
||||
|
|
|
@ -112,7 +112,7 @@ class Trace < ActiveRecord::Base
|
|||
elsif zipped
|
||||
mimetype = "application/x-zip"
|
||||
else
|
||||
mimetype = "text/xml"
|
||||
mimetype = "application/gpx+xml"
|
||||
end
|
||||
|
||||
return mimetype
|
||||
|
|
Loading…
Add table
Reference in a new issue