Esri / geoportal-server-catalog

Esri Geoportal Server is a next generation open-source metadata catalog and editor, based on elasticsearch.
https://www.esri.com/en-us/arcgis/products/geoportal-server/overview
Apache License 2.0
97 stars 60 forks source link

CswClient HTTP GET with Content-Type #384

Closed lindhor closed 3 years ago

lindhor commented 3 years ago

In https://github.com/Esri/geoportal-server-catalog/blob/master/components/CswClient/Pro/CswClient/Common/CswClient.cs#L96 the Content-Type is set to text/xml even if no body is being sent. If I understand it correctly GET requests should not have the Content-Type header specified. We have at least one server that does not allow Content-Type with an empty body.

If I understand the code correctly it would be needed to call SubmitHttpRequest with method DOWNLOAD -or- to make a general exception in SubmitHttpRequest for GET-requests to not set the request.ContentType (i.e. by wrapping the line https://github.com/Esri/geoportal-server-catalog/blob/master/components/CswClient/Pro/CswClient/Common/CswClient.cs#L96 in an if(method.Equals("GET")), which I think is the way to go).

If I have misunderstood the code and this behaviour is configurable, please let me know.

mhogeweg commented 3 years ago

I think you have the right view on this. if you do decide to make this update, we'd be happy to take a pull request for it!