Pertains to REST framework, creating postgis datastore; if password contains '&' respons = 500

Description

POST /workspaces/{workspaceName}/datastores

This payload in the REST request leads to a 500 status, caused by password:

<dataStore>
<name>store_a</name>
<connectionParameters>
<host>localhost</host>
<port>5432</port>
<database>db1</database>
<user>postgres</user>
<passwd>&</passwd>
<dbtype>postgis</dbtype>
</connectionParameters>
</dataStore>

Environment

ubuntu 2.20.04, tomcat 9.0.46, open JDK 11.0.11

Activity

Bart den Ouden 
July 20, 2021 at 2:51 PM

Hi Ian,

You are right: not a bug in GeoServer but a consequence of XML the developper needs te be aware of. I’m not too familiar with XML. The lesson I took from it that it is better to use json in the body of the request. Very nice that GeoServer supports both.

Best regards, Bart

Ian Turton 
July 16, 2021 at 9:58 AM

That would be invalid XML - what happens if you use &amp; instead if &

Not a Bug

Details

Assignee

Reporter

Triage

Affects versions

Priority

Created July 15, 2021 at 7:13 PM
Updated July 20, 2021 at 3:21 PM
Resolved July 20, 2021 at 3:21 PM