Modify

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#9715 closed enhancement (fixed)

Improve HTTP support for styles and presets web queries

Reported by: francois.lacombe@… 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 Changed 8 years ago by Don-vip

Point 2 should be easy.
For point 1, could you please give us credentials to your web server, for test purpose?

comment:2 Changed 8 years ago by francois.lacombe

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 in reply to:  2 Changed 8 years ago by Don-vip

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?

comment:4 Changed 8 years ago by Don-vip

In 6856/josm:

see #9715 - do not block start when external presets cannot be retrieved, save the error for later display in global network errors message dialog

comment:5 Changed 8 years ago by simon04

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?

comment:6 in reply to:  5 ; Changed 8 years ago by Don-vip

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 in reply to:  6 Changed 8 years ago by francois.lacombe

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 Changed 8 years ago by francois.lacombe

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:9 Changed 8 years ago by Don-vip

Oh I get it: the dialog does not appear behind a proxy.

comment:10 Changed 8 years ago by francois.lacombe

And the dialog does not appear when the password is saved. Obviously.

comment:11 Changed 8 years ago by Don-vip

Keywords: mime added
Milestone: 14.02

comment:12 Changed 8 years ago by Don-vip

Resolution: fixed
Status: newclosed

In 6867/josm:

fix #9715 - Set HTTP Accept header to expected MIME types when downloading presets, styles, plugins

comment:13 Changed 8 years ago by stoecker

It is "text/x-mapcss".

comment:14 Changed 8 years ago by stoecker

In 6868/josm:

see #9715 - mapcss mime type

comment:15 Changed 8 years ago by francois.lacombe

Test account josm.test9715 has been disabled for security purposes.

If dev staff needs to recover access on it please ask.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.