Skip to content

Set ContentType to application/gpx+xml - #693

Closed
boldtrn wants to merge 1 commit into
graphhopper:masterfrom
boldtrn:fix_content_header
Closed

boldtrn wants to merge 1 commit into
graphhopper:masterfrom
boldtrn:fix_content_header

Conversation

@boldtrn

@boldtrn boldtrn commented Mar 29, 2016

Copy link
Copy Markdown
Member

The ContentType for .gpx files should be application/gpx+xml. Also see here for more details: https://en.wikipedia.org/wiki/GPS_Exchange_Format

I had a small amount of users that received the file as filename.gpx.xml. It seems like this fixes the issue.

@karussell

Copy link
Copy Markdown
Member

Hmmh, difficult to decide as there are lots of applications outside that we would need to re-test again. See duplicate #676

@boldtrn

boldtrn commented Mar 29, 2016

Copy link
Copy Markdown
Member Author

Sorry, haven't seen the other ticket. I changed it for kurviger.de and wanted to commit the improvement back to GraphHopper. One major decision towards that content type was also this link. I think it should not break any other applications. But we still have to test it :(.

@karussell

Copy link
Copy Markdown
Member

Maybe @ratrun you have some experience which applications we really should test? At least 2 online tools, 2 navis and this Garmin application which I cannot remember anymore. Hmmh, but wait: the file type should not influence the bytes (?) so if both are equal we should be able to change this even without much testing?

@boldtrn

boldtrn commented Apr 2, 2016

Copy link
Copy Markdown
Member Author

@karussell

This only changes the http header information of the content-type. This should only influence services that download gpx files from GraphHopper. The file itself should stay the same.

Some browser/pc/setting combination changes the file ending of the downloaded file to .xml since the content-type was xml.

BTW: I guess you mean BaseCamp.

@karussell

Copy link
Copy Markdown
Member

BTW: I guess you mean BaseCamp

ah, yes.
Okay. So, we 'just' need to make sure that the API clients still work properly :)

@karussell

karussell commented May 10, 2016 •

Copy link
Copy Markdown
Member

Ok, I've asked one and the client still works with this change.

Can you further add this fallback if the client is explicitly asking for it?

if("application/xml".equals(req.getContentType())) // toLowerCase?
 res.setContentType("application/xml")
else
 res.setContentType("application/gpx+xml")

@karussell

Copy link
Copy Markdown
Member

Fixed

@karussell karussell closed this May 11, 2016
@boldtrn

boldtrn commented May 11, 2016

Copy link
Copy Markdown
Member Author

Thanks. 👍

@boldtrn
boldtrn deleted the fix_content_header branch October 6, 2017 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants