TerriaJS / nationalmap

Australia's NationalMap
https://nationalmap.gov.au
122 stars 45 forks source link

Australian Marine Energy Atlas -HTTP POST proxy issue #1262

Closed nf-s closed 3 months ago

nf-s commented 3 months ago

In NationalMap catalog - open

Request will time out through our proxy

For example -

curl 'https://nationalmap.gov.au/proxy/_1d/http://oa-gis.csiro.au/geonetwork/srv/eng/csw' -X POST -H 'Content-Type: application/xml' --data-raw $'<?xml version="1.0" encoding="utf-8"?>\n<csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" version="2.0.2" service="CSW" resultType="results" startPosition="1" maxRecords="100">\n    <csw:Query typeNames="csw:Record" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml">\n        <csw:ElementSetName>full</csw:ElementSetName>\n        <csw:Constraint version="1.1.0">\n            <ogc:Filter>\n                <ogc:Or>\n                    <ogc:PropertyIsLike wildCard="%" singleChar="#" escapeChar="\041">\n                        <ogc:PropertyName>dc:format</ogc:PropertyName>\n                        <ogc:Literal>%WMS%</ogc:Literal>\n                    </ogc:PropertyIsLike>\n                    <ogc:PropertyIsLike wildCard="%" singleChar="#" escapeChar="\041">\n                        <ogc:PropertyName>OnlineResourceType</ogc:PropertyName>\n                        <ogc:Literal>%WMS%</ogc:Literal>\n                    </ogc:PropertyIsLike>\n                    <ogc:PropertyIsLike wildCard="%" singleChar="#" escapeChar="\041">\n                        <ogc:PropertyName>apiso:ServiceType</ogc:PropertyName>\n                        <ogc:Literal>%WMS%</ogc:Literal>\n                    </ogc:PropertyIsLike>\n                </ogc:Or>\n            </ogc:Filter>\n        </csw:Constraint>\n    </csw:Query>\n</csw:GetRecords>\n'

If you remove https://nationalmap.gov.au/proxy/_1d/ then request will work

curl 'http://oa-gis.csiro.au/geonetwork/srv/eng/csw' -X POST -H 'Content-Type: application/xml' --data-raw $'<?xml version="1.0" encoding="utf-8"?>\n<csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" version="2.0.2" service="CSW" resultType="results" startPosition="1" maxRecords="100">\n    <csw:Query typeNames="csw:Record" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml">\n        <csw:ElementSetName>full</csw:ElementSetName>\n        <csw:Constraint version="1.1.0">\n            <ogc:Filter>\n                <ogc:Or>\n                    <ogc:PropertyIsLike wildCard="%" singleChar="#" escapeChar="\041">\n                        <ogc:PropertyName>dc:format</ogc:PropertyName>\n                        <ogc:Literal>%WMS%</ogc:Literal>\n                    </ogc:PropertyIsLike>\n                    <ogc:PropertyIsLike wildCard="%" singleChar="#" escapeChar="\041">\n                        <ogc:PropertyName>OnlineResourceType</ogc:PropertyName>\n                        <ogc:Literal>%WMS%</ogc:Literal>\n                    </ogc:PropertyIsLike>\n                    <ogc:PropertyIsLike wildCard="%" singleChar="#" escapeChar="\041">\n                        <ogc:PropertyName>apiso:ServiceType</ogc:PropertyName>\n                        <ogc:Literal>%WMS%</ogc:Literal>\n                    </ogc:PropertyIsLike>\n                </ogc:Or>\n            </ogc:Filter>\n        </csw:Constraint>\n    </csw:Query>\n</csw:GetRecords>\n'
nf-s commented 3 months ago

This is also impacting WPS POST requests

Through proxy - will fail

curl 'https://nationalmap.gov.au/proxy/_1d/http://oa-gis.csiro.au/wps?service=WPS&request=Execute&version=1.0.0' -X POST --data-raw $'<?xml version="1.0" encoding="UTF-8"?>\n<wps:Execute version="1.0.0" service="WPS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.opengis.net/wps/1.0.0" xmlns:wfs="http://www.opengis.net/wfs" xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:wcs="http://www.opengis.net/wcs/1.1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd">\n  <ows:Identifier>annual-waverose</ows:Identifier>\n  <wps:DataInputs>\n    <wps:Input>\n      <ows:Identifier>LonLatPosition</ows:Identifier>\n      <wps:Data>\n        <wps:ComplexData>{"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[120.45522790643727,-19.769164529015324,4.877287420743565]},"properties":{}}]}</wps:ComplexData>\n      </wps:Data>\n    </wps:Input>\n    <wps:Input>\n      <ows:Identifier>starttime</ows:Identifier>\n      <wps:Data>\n        <wps:ComplexData>{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time","date-time":"2020-01-01T00:00"}}}</wps:ComplexData>\n      </wps:Data>\n    </wps:Input>\n    <wps:Input>\n      <ows:Identifier>stoptime</ows:Identifier>\n      <wps:Data>\n        <wps:ComplexData>{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time","date-time":"2021-01-01T00:00"}}}</wps:ComplexData>\n      </wps:Data>\n    </wps:Input>\n  </wps:DataInputs>\n  <wps:ResponseForm>\n    <wps:ResponseDocument storeExecuteResponse="true" status="true"/>\n  </wps:ResponseForm>\n</wps:Execute>\n'

Direct request - will succeed

curl 'http://oa-gis.csiro.au/wps?service=WPS&request=Execute&version=1.0.0' -X POST --data-raw $'<?xml version="1.0" encoding="UTF-8"?>\n<wps:Execute version="1.0.0" service="WPS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.opengis.net/wps/1.0.0" xmlns:wfs="http://www.opengis.net/wfs" xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:wcs="http://www.opengis.net/wcs/1.1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd">\n  <ows:Identifier>annual-waverose</ows:Identifier>\n  <wps:DataInputs>\n    <wps:Input>\n      <ows:Identifier>LonLatPosition</ows:Identifier>\n      <wps:Data>\n        <wps:ComplexData>{"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[120.45522790643727,-19.769164529015324,4.877287420743565]},"properties":{}}]}</wps:ComplexData>\n      </wps:Data>\n    </wps:Input>\n    <wps:Input>\n      <ows:Identifier>starttime</ows:Identifier>\n      <wps:Data>\n        <wps:ComplexData>{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time","date-time":"2020-01-01T00:00"}}}</wps:ComplexData>\n      </wps:Data>\n    </wps:Input>\n    <wps:Input>\n      <ows:Identifier>stoptime</ows:Identifier>\n      <wps:Data>\n        <wps:ComplexData>{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time","date-time":"2021-01-01T00:00"}}}</wps:ComplexData>\n      </wps:Data>\n    </wps:Input>\n  </wps:DataInputs>\n  <wps:ResponseForm>\n    <wps:ResponseDocument storeExecuteResponse="true" status="true"/>\n  </wps:ResponseForm>\n</wps:Execute>\n'
nf-s commented 3 months ago

I was able to upgrade oa-gis.csiro.au from HTTP to HTTPS - and CORS is enabled so I have removed from the proxy list.