jerome077 / gpsvp

Automatically exported from code.google.com/p/gpsvp
5 stars 2 forks source link

user-agent change in gpsVP (WMS server only talking to web browsers) #61

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create the following map configuration file
[Tiled MAP]
gpsVPVersionMin=0.4.15
Filename=cuzk-x=%X&y=%Y&zoom=%ZOOM_17.png
URL=http://geoportal.cuzk.cz/wmsdata13/RASZM10/wms.asp?SID=&request=GetMap&SERVI
CE=WMS&VERSION=1.3.0&FORMAT=image/png&CRS=EPSG:4326&BBOX=%LONG1,%LAT1,%LONG2,%LA
T2&WIDTH=256&HEIGHT=256&TRANSPARENT=True&LAYERS=GR_CR4,GR_MCR500,GR_ZM10&STYLES=
,,
DemoPointLon=17.52397
DemoPointLat=49.17592
DemoPointZoomOne=16
2. Go to the demo point. Gpsvp can't load the map.

Steps will reproduce with telnet:
 1. Open a telnet session: telnet geoportal.cuzk.cz 80 
 2. Paste the following request, you will get a picture:
GET
/wmsdata13/RASZM10/wms.asp?SID=&request=GetMap&SERVICE=WMS&VERSION=1.3.0&FORMAT=
image/png&CRS=EPSG:4326&BBOX=17.52319335937500,49.17452151806796,17.534179687500
00,49.18170338770671&WIDTH=256&HEIGHT=256&TRANSPARENT=True&LAYERS=GR_CR4,GR_MCR5
00,GR_ZM10&STYLES=,,
HTTP/1.0
Host: geoportal.cuzk.cz
User-Agent: Mozilla/5.0

Request: True

 3. Open a telnet session: telnet geoportal.cuzk.cz 80 
 4. Paste the following request. You won't get a picture.
GET
/wmsdata13/RASZM10/wms.asp?SID=&request=GetMap&SERVICE=WMS&VERSION=1.3.0&FORMAT=
image/png&CRS=EPSG:4326&BBOX=17.52319335937500,49.17452151806796,17.534179687500
00,49.18170338770671&WIDTH=256&HEIGHT=256&TRANSPARENT=True&LAYERS=GR_CR4,GR_MCR5
00,GR_ZM10&STYLES=,,
HTTP/1.0
Host: geoportal.cuzk.cz
User-Agent: gpsVP 0.4.16

Request: True

This web server apparently just accept requests from known browsers. It
would interesting to have a setting to set the User-Agent.
(a global setting in the registry or a specific setting in the map
configuration file?)

Original issue reported on code.google.com by jerome077 on 27 Jan 2009 at 9:33

GoogleCodeExporter commented 9 years ago

Original comment by jerome077 on 27 Jan 2009 at 9:34

GoogleCodeExporter commented 9 years ago
This server (geoportal.cuzk.cz) isn't a true WMS server it just simulate the WMS
interface but just work for one precise zoom level. That's probably why it 
check the
USer-Agent and just allow browsers. A setting for the UserAgent won't help to 
use
this server.
Currently there is no other known usages for such a setting in gpsvp => low 
priority.

Original comment by jerome077 on 12 May 2009 at 8:59

GoogleCodeExporter commented 9 years ago
For debugging purposes it would be nice to put more information into 
"user-agent"
string. Hardware , operating system , gpsVP copilation version.
Below is some logs from web server - how web browser presents itself and how 
gpsVP
presents. 

xxx.162.83.120 tiles.ump.waw.pl - [11/May/2010:18:59:45 +0200] "GET
/osm_tiles2.fast/4/8/5.png HTTP/1.1" 404 345 "-" "SAMSUNG-SGH-i600/1.0 
(compatible;
MSIE 6.0; Windows CE; IEMobile 6.8)"

xxx.174.24.251 tiles.ump.waw.pl - [26/Apr/2010:20:32:58 +0200] "GET
/ump_tiles/5/17/9.png HTTP/1.0" 200 7308 "-" "gpsVP 0.4.21"

xxx.160.172.70 tiles.ump.waw.pl - [06/May/2010:10:01:18 +0200] "GET
/ump_tiles/6/34/19.png HTTP/1.0" 200 5541 "-" "gpsVP 0.4.18"

xxx.27.144.127 tiles.ump.waw.pl - [09/May/2010:11:51:12 +0200] "GET
/ump_tiles/15/17955/10975.png HTTP/1.0" 200 3149 "-" "gpsVP 0.4.20"

Original comment by rydze...@gmail.com on 22 May 2010 at 9:50