should Mapserver WMS client URL encode?
Paul Ramsey
pramsey at REFRACTIONS.NET
Fri Mar 25 15:19:04 EST 2005
As a followup to the discussion of encoding WMS URL parameters, the
logic in the mapwmslayer.c file seems to be backwards (and partially
missing).
The msSetWMSParamString function includes a boolean to optionally
encode the values passed (which is nice planning):
static int msSetWMSParamString(wmsParamsObj *psWMSParams,
const char *name, const char * value,
int urlencode)
But the calls to the function seem to use it backwards, encoding things
that shouldn't be encoded (LAYERS, BBOX, STYLES) and not encoding
others:
msSetWMSParamString(psWMSParams, "LAYERS", pszName, MS_TRUE);
msSetWMSParamString(psWMSParams, "TRANSPARENT", "TRUE", MS_FALSE);
snprintf(szBuf, 100, "%.15g,%.15g,%.15g,%.15g",
bbox.minx, bbox.miny, bbox.maxx, bbox.maxy);
msSetWMSParamString(psWMSParams, "BBOX", szBuf, MS_TRUE);
It doesn't look like the individual layers get encoded either. So the
upshot is that the Mapserver WMS client is probably generating
out-of-spec requests.
Paul
More information about the mapserver-dev
mailing list