[Geoserver-devel] [JIRA] (GEOS-10986) Double URL-decoding for tilecache CQL_FILTER parameter?

Peter Smythe created an issue

GeoServer / BugGEOS-10986

Double URL-decoding for tilecache CQL_FILTER parameter?

Issue Type:

BugBug

Affects Versions:

2.22.2

Assignee:

Unassigned

Attachments:

image-20230522-111410 (2292931d-e0ef-4e22-8995-fbaf65b22d4a).png, image-20230522-111410.png

Created:

22/May/23 1:21 PM

Priority:

MediumMedium

Reporter:

Peter Smythe

Sample URL: https://localhost:8080/geoserver/wms?CQL_FILTER=time+DURING+2021-01-01T00:00:00%2B02:00/2023-05-21T23:59:00%2B02:00&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&tiled=true&STYLES&LAYERS=workspace:layer&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&BBOX=22.5%2C-33.75%2C28.125%2C-28.125

Specifically notice the CQL_FILTER acting on the time property, using ECQL DURING which takes a period.

The period is correctly URL encoded as 2021-01-01T00:00:00%2B02:00/2023-05-21T23:59:00%2B02:00, which URL-decoded is 2021-01-01T00:00:00+02:00/2023-05-21T23:59:00+02:00. Note the timezone is specified using a plus sign: +02:00.

This CQL works correctly when requesting un-tiled layers. However, if tiling is enabled, and the correct filter is configured in the Tile Caching tab:

then the image returned is blank. In the logs, the following can be observed:

22 May 12:57:31 ERROR  [geoserver.ows] -
org.geoserver.platform.ServiceException: Could not parse CQL filter list.
	at org.geoserver.ows.kvp.CQLFilterKvpParser.parse(CQLFilterKvpParser.java:29)
	at org.geoserver.ows.util.KvpUtils.parse(KvpUtils.java:438)
	at org.geoserver.ows.Dispatcher.parseKVP(Dispatcher.java:1495)
	at org.geoserver.ows.Dispatcher.parseKVP(Dispatcher.java:1491)
	at org.geoserver.ows.Dispatcher.init(Dispatcher.java:319)
	at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:238)
	at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:177)
	at org.geoserver.gwc.GWC.dispatchOwsRequest(GWC.java:1368)
	at org.geoserver.gwc.layer.GeoServerTileLayer.dispatchGetMap(GeoServerTileLayer.java:693)
<snip>
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: org.geotools.filter.text.cql2.CQLException: Encountered "DURING 2021-01-01T00:00:00 02" at line 1, column 6.
Was expecting one of:
    "(" ...
<snip>
    "during" <DATE_TIME> "/" ...
    "during" <DURATION> ...
<snip>
     Parsing : time DURING 2021-01-01T00:00:00 02:00/2023-05-21T23:59:00 02:00.
	at org.geotools.filter.text.ecql.ECQLCompiler.compileFilterList(ECQLCompiler.java:116)
	at org.geotools.filter.text.commons.CompilerUtil.parseFilterList(CompilerUtil.java:214)
	at org.geotools.filter.text.ecql.ECQL.toFilterList(ECQL.java:176)
<snip>

Note the period that geotools is unsuccessfully trying to parse: time DURING 2021-01-01T00:00:00 02:00/2023-05-21T23:59:00 02:00``, specifically the timezone: {{ 02:00}}`, where the plus sign has been double URL decoded to a space, which makes the period not a valid time period.

Add Comment

Add Comment

Get Jira notifications on your phone! Download the Jira Cloud app for Android or iOS


This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100225-sha1:bbd69a1)

Atlassian logo