Opened 15 years ago
Closed 5 years ago
#2750 closed defect (wontfix)
WMS requests are not urlencoded
Reported by: | geochuck | Owned by: | nowakpl |
---|---|---|---|
Priority: | normal | Milestone: | closed_because_of_github_migration |
Component: | GDAL_Raster | Version: | unspecified |
Severity: | normal | Keywords: | wms urlencode |
Cc: | warmerdam |
Description (last modified by )
It appears that GDAL WMS requests are not urlencoded. This a space in the url ends up truncating the request. Example:
<ImageFormat>image/png; mode=24bit</ImageFormat>
Here is a test WMS file:
<GDAL_WMS> <Service name="WMS"> <Version>1.1.1</Version> <ServerURL>http://giifmap.cnr.berkeley.edu/cgi-bin/naip.wms?</ServerUrl> <SRS>EPSG:4326</SRS> <ImageFormat>image/png; mode=24bit</ImageFormat> <Layers>naip2005</Layers> </Service> <DataWindow> <UpperLeftX>-124.45</UpperLeftX> <UpperLeftY>42.0421</UpperLeftY> <LowerRightX>-113.222</LowerRightX> <LowerRightY>32.2006</LowerRightY> <SizeX>1247554</SizeX> <SizeY>1093499</SizeY> </DataWindow> <BandsCount>3</BandsCount> <ClampRequests>false</ClampRequests> </GDAL_WMS>
Attachments (2)
Change History (7)
comment:1 by , 15 years ago
Cc: | added |
---|---|
Description: | modified (diff) |
Keywords: | wms urlencode added |
Owner: | changed from | to
by , 15 years ago
Attachment: | gdal-r16174-t2750.patch added |
---|
by , 15 years ago
Attachment: | gdal-r16174-t2750-2.patch added |
---|
comment:3 by , 15 years ago
gdal-r16174-t2750-2.patch looks good, but I think we need to add some magic in UrlEncode() for backward compatibility, so that it still works for people who have already workaround the problem by urlencoding at hand.
For example, in "image%2Fpng%3B+mode%3D24bit" we see '%XY' patterns (where X and Y are hex characters), so we could suppose that it is already url encoded and just return the unmodified string.
comment:4 by , 10 years ago
Motion: While waiting for a real fix, add a line about the possible need to use url-encoding at least for problematic characters inside GDAL WMS file. Instead of for example "image/png; mode=8bit" write completely url-encoded <ImageFormat>image%2Fpng%3B%20mode%3D8bit</ImageFormat> or simplified <ImageFormat>image/png%3B%20mode=8bit</ImageFormat>
Working example for Geoserver demo layer topp:states
<GDAL_WMS> <Service name="WMS"> <Version>1.1.1</Version> <ServerURL>http://localhost:8080/geoserver/wms?</ServerURL> <SRS>EPSG:4326</SRS> <ImageFormat>image/png%3B%20mode=8bit</ImageFormat> <Layers>topp:states</Layers> </Service> <DataWindow> <UpperLeftX>-124.45</UpperLeftX> <UpperLeftY>42.0421</UpperLeftY> <LowerRightX>-113.222</LowerRightX> <LowerRightY>32.2006</LowerRightY> <SizeX>1247554</SizeX> <SizeY>1093499</SizeY> </DataWindow> <BandsCount>3</BandsCount> <ClampRequests>false</ClampRequests> </GDAL_WMS>
comment:5 by , 5 years ago
Milestone: | → closed_because_of_github_migration |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
This ticket has been automatically closed because Trac is no longer used for GDAL bug tracking, since the project has migrated to GitHub. If you believe this ticket is still valid, you may file it to https://github.com/OSGeo/gdal/issues if it is not already reported there.
Adam,
Can you review, and prepare an appropriate patch?