geonetwork / geonetwork-microservices

GNU General Public License v2.0
13 stars 18 forks source link

OGC API Records / Collection / Item view may return error #84

Closed fxprunayre closed 1 year ago

fxprunayre commented 1 year ago

Problem is related to the query associated with the collection (it does not happen on the main collection).

Eg. if the portal filter contains quote in the filter. Those were not escaped.

<message>Request processing failed; nested exception is java.lang.RuntimeException: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('0' (code 48)): was expecting comma to separate Object entries at [Source: (String)"{"from": 0, "size": 1, "query": {"query_string": {"query": "+_id:\"5e8864c4-35f8-5e8b-38e3-21be-954e-1579-bd3916db\" +harvesterUuid:"09ec5462-eb74-4209-9937-fabcf8c14efb" +isTemplate:n AND -indexingError:true"}}, "_source": {"includes": ["*"]}}"; line: 1, column: 135]</message>
<stackTrace>org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014)

When using the proxy, the query string must be escaped.

eg. for testing, create a portal with a filter like +tag.default:"Lijst M&R INSPIRE"

joachimnielandt commented 1 year ago

tested locally