Opened 13 years ago
Closed 13 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
/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
Change History (5)
comment:1 by , 13 years ago
comment:2 by , 13 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?
follow-up: 4 comment:3 by , 13 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.
comment:4 by , 13 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=recursiveThe 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=19711and be pushed into the background of the bash shell.
OK, I'm stupid. :) For easier copy & past I normally wrap args in single quotes.
In 5008/josm: