#9715 closed enhancement (fixed)
Improve HTTP support for styles and presets web queries
Reported by: | Owned by: | team | |
---|---|---|---|
Priority: | normal | Milestone: | 14.02 |
Component: | Core | Version: | |
Keywords: | presets, styles, auth, http, mime | Cc: |
Description
Hello,
I'm trying to access web published presets and style documents on a web server which asks me for credentials to grant me access.
JOSM doesn't seems to support HTTP Auth when downloading shuch config files because it only displays me "Unexpected end of file" resulting from a server side HTTP 401 answer.
JOSM doesn't asks for such credentials at any time.
Could you please add:
- HTTP Auth support, even Basic, to load presets and styles (and maybe for css validation files too)?
- Proper HTTP Accept header value to loading requests according to file extension (or expected by JOSM directly) to properly match HTTP 1.1 spécification.
Currently, JOSM is sending "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" as Accept header for a preset file loading query, which is wrong. JOSM expects xml only, thus it should send "application/xml" or "text/xml" as Accept header value.
Many thanks in advance to give a positive feedback to this ticket.
Attachments (0)
Change History (15)
comment:1 by , 11 years ago
follow-up: 3 comment:2 by , 11 years ago
I'm glad you accept pt 1 !
You can have access to the secured files with URLs :
GET http://orion.infos-reseaux.com/apps/ws_josm/files/presets [Accept: text/xml]
GET http://orion.infos-reseaux.com/apps/ws_josm/files/styles [Accept: text/css]
Credentials : josm.test9715 : ghjs59fh.mp/
You can use HTTP Basic even if server send you back a 401 with Digest information.
For point 2, accepted mime was given as an example and should be refined accordingly to what JOSM really expects.
comment:3 by , 11 years ago
Replying to francois.lacombe@…:
You can have access to the secured files with URLs :
I can access the first link but not the second one, can you check on your side?
follow-up: 6 comment:5 by , 11 years ago
When adding http://orion.infos-reseaux.com/apps/ws_josm/files/presets in the preferences, a dialog appears asking for the authentication information. After entering the credentials from comment:2 and restarting JOSM, the presets appear in the menu.
However, some images seem to fail to load:
ERROR: Failed to locate image 'http://common.infos-reseaux.com/UI/dataPrimitive_ui/img/objects_images/fr-stcsystems-libs-topoData-Model_VAEP_small.png' WARNING: Could not get presets icon http://common.infos-reseaux.com/UI/dataPrimitive_ui/img/objects_images/fr-stcsystems-libs-topoData-Model_VAEP_small.png ERROR: Failed to locate image 'http://common.infos-reseaux.com/UI/dataPrimitive_ui/img/objects_images/fr-stcsystems-libs-topoData-Model_CAEP_small.png' WARNING: Could not get presets icon http://common.infos-reseaux.com/UI/dataPrimitive_ui/img/objects_images/fr-stcsystems-libs-topoData-Model_CAEP_small.png ERROR: Failed to locate image 'http://common.infos-reseaux.com/UI/dataPrimitive_ui/img/objects_images/fr-stcsystems-libs-topoData-Model_VAEP_small.png' WARNING: Could not get presets icon http://common.infos-reseaux.com/UI/dataPrimitive_ui/img/objects_images/fr-stcsystems-libs-topoData-Model_VAEP_small.png ERROR: Failed to locate image 'http://common.infos-reseaux.com/UI/dataPrimitive_ui/img/objects_images/fr-stcsystems-libs-topoData-Model_CAEP_small.png' WARNING: Could not get presets icon http://common.infos-reseaux.com/UI/dataPrimitive_ui/img/objects_images/fr-stcsystems-libs-topoData-Model_CAEP_small.png
How did you proceed?
follow-up: 7 comment:6 by , 11 years ago
Replying to simon04:
When adding http://orion.infos-reseaux.com/apps/ws_josm/files/presets in the preferences, a dialog appears asking for the authentication information.
Waw, seriously? I haven't seen this dialog and didn't think we already had a basic authentication system o_O I didn't do anything yet on the subject.
comment:7 by , 11 years ago
Replying to Don-vip:
I can access the first link but not the second one, can you check on your side?
You can't because the Accept header in the request sent by JOSM doesn't contain "text/css" in the list of accepted mimes.
My server is checking that before sending results. If you wheck the HTTP response status, it may be a 406 Not Acceptable.
I use text/css because I don't know the exact mime for MapCSS.
Replying to Don-vip:
Waw, seriously? I haven't seen this dialog and didn't think we already had a basic authentication system o_O I didn't do anything yet on the subject.
The same as you, I didn't notice this logon screen at all before.
Wireshark told me JOSM using Digest auth to answer my server.
This is really REALLY great.
And it's the same with API authentication, JOSM uses Digest when server say he has to. A very nice job guys.
The only thing remaining to correct is the Accept header then.
comment:8 by , 11 years ago
Regarding images which don't load, that's because styles are being generated automatically. Some of the images aren't available on server but I'm thinking to correct it and writing a default URL instead.
You don't have to deal with those errors which are totally on my side.
comment:11 by , 11 years ago
Keywords: | mime added |
---|---|
Milestone: | → 14.02 |
comment:15 by , 11 years ago
Test account josm.test9715 has been disabled for security purposes.
If dev staff needs to recover access on it please ask.
Point 2 should be easy.
For point 1, could you please give us credentials to your web server, for test purpose?