Modify

Opened 14 years ago

Closed 14 years ago

#7434 closed defect (fixed)

remotecontrol: URLs with "&" and "?" character don't work

Reported by: werner2101 Owned by: team
Priority: normal Milestone:
Component: Core Version: latest
Keywords: remote control Cc:

Description

I'm running a server at localhost:8888 that can deliver osm xml data.

When I try to load data in josm with the import command:

wget -Oresult.txt http://localhost:8111/import?url=http://localhost:8888/relations?relations=19711\&mode=recursive

Then the josm does not load the data.

If I encode the URL of the second server:

wget -Oresult.txt http://localhost:8111/import?url=http://localhost:8888/relations%3Frelations=19711%26mode=recursive

then josm loads the right data from the localhost server 8888.

I get the following commandline output when using the first url without encoding:

werner@linux-g0e5:~/osm> wget -Oresult.txt http://localhost:8111/import?url=http://localhost:8888/relations?relations=19711\&mode=recursive


asking libproxy about url 'http://localhost:8111/import?url=http://localhost:8888/relations?relations=19711&mode=recursive'


libproxy suggest to use 'direct://'


--2012-02-20 19:55:13-- http://localhost:8111/import?url=http://localhost:8888/relations?relations=19711&mode=recursive


Auflösen des Hostnamen »localhost (localhost)«... ::1, 127.0.0.1

Verbindungsaufbau zu localhost (localhost)|::1|:8111... fehlgeschlagen: Verbindungsaufbau abgelehnt.

Verbindungsaufbau zu localhost (localhost)|127.0.0.1|:8111... verbunden.

HTTP-Anforderung gesendet, warte auf Antwort... RemoteControl received: GET /import?url=http://localhost:8888/relations?relations=19711&mode=recursive HTTP/1.1

GET http://localhost:8888/relations

/relations

localhost - - [20/Feb/2012 19:55:13] "GET /relations HTTP/1.1" 404 -

200 OK

Länge: 4 [text/plain]

In »»result.txt«« speichern.

100%[=================================================================================================================================>] 4 --.-K/s in 0s

2012-02-20 19:55:13 (327 KB/s) - »»result.txt«« gespeichert [4/4]

Note: the line RemoteControl received is ok, but in the next line GET ... the url is incomplete

JOSM version 4878

OS: SuSE Linux 12.1


Attachments (0)

Change History (5)

comment:1 by bastiK, 14 years ago

In 5008/josm:

remotecontrol: tolerate '?' in query part of url (see #7434)

comment:2 by bastiK, 14 years ago

In

http://localhost:8111/import?url=http://localhost:8888/relations?relations=19711\&mode=recursive

what does "\&" mean? Is this specified in any RFC?

comment:3 by werner2101, 14 years ago

The backslash escapes the "&" in the bash shell and the url becomes

http://localhost:8111/import?url=http://localhost:8888/relations?relations=19711&mode=recursive

The url is repeated correctly in the next line starting with "asking libproxy about url".

If I won't escape it, the command would stop at the "&"

http://localhost:8111/import?url=http://localhost:8888/relations?relations=19711

and be pushed into the background of the bash shell.

The problem is, that JOSM does not forward everything beyound the "?" to the server.

in reply to:  3 comment:4 by bastiK, 14 years ago

Replying to werner2101:

The backslash escapes the "&" in the bash shell and the url becomes

http://localhost:8111/import?url=http://localhost:8888/relations?relations=19711&mode=recursive

The url is repeated correctly in the next line starting with "asking libproxy about url".

If I won't escape it, the command would stop at the "&"

http://localhost:8111/import?url=http://localhost:8888/relations?relations=19711

and be pushed into the background of the bash shell.

OK, I'm stupid. :) For easier copy & past I normally wrap args in single quotes.

comment:5 by bastiK, 14 years ago

Resolution: fixed
Status: newclosed

In 5010/josm:

fixed #7434 - remotecontrol: URLs with "&" and "?" character don't work

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. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.