Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45376 from mhugent/server_capabilities_url_fix
Take query parameters for url advertised in capabilities from the original request
- Loading branch information
Showing
3 changed files
with
354 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
328 changes: 328 additions & 0 deletions
328
tests/testdata/qgis_server/wms_getcapabilities_rewriting.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,328 @@ | ||
Content-Length: 14317 | ||
Content-Type: text/xml; charset=utf-8 | ||
|
||
<?xml version="1.0" encoding="utf-8"?> | ||
<WMS_Capabilities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:qgs="http://www.qgis.org/wms" xmlns="http://www.opengis.net/wms" xsi:schemaLocation="http://www.opengis.net/wms http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xsd http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/sld_capabilities.xsd http://www.qgis.org/wms http://localhost/wms/test_project?SERVICE=WMS&REQUEST=GetSchemaExtension" version="1.3.0" xmlns:sld="http://www.opengis.net/sld"> | ||
<Service> | ||
<Name>WMS</Name> | ||
<Title>QGIS TestProject</Title> | ||
<Abstract><![CDATA[Some UTF8 text èòù]]></Abstract> | ||
<KeywordList> | ||
<Keyword vocabulary="ISO">infoMapAccessService</Keyword> | ||
</KeywordList> | ||
<OnlineResource xlink:type="simple" xlink:href="http://localhost/wms/test_project" xmlns:xlink="http://www.w3.org/1999/xlink"/> | ||
<ContactInformation> | ||
<ContactPersonPrimary> | ||
<ContactPerson>Alessandro Pasotti</ContactPerson> | ||
<ContactOrganization>QGIS dev team</ContactOrganization> | ||
</ContactPersonPrimary> | ||
<ContactElectronicMailAddress>elpaso@itopen.it</ContactElectronicMailAddress> | ||
</ContactInformation> | ||
<Fees>conditions unknown</Fees> | ||
<AccessConstraints>None</AccessConstraints> | ||
</Service> | ||
<Capability> | ||
<Request> | ||
<GetCapabilities> | ||
<Format>text/xml</Format> | ||
<DCPType> | ||
<HTTP> | ||
<Get> | ||
<OnlineResource xlink:type="simple" xlink:href="http://localhost/wms/test_project?" xmlns:xlink="http://www.w3.org/1999/xlink"/> | ||
</Get> | ||
</HTTP> | ||
</DCPType> | ||
</GetCapabilities> | ||
<GetMap> | ||
<Format>image/jpeg</Format> | ||
<Format>image/png</Format> | ||
<Format>image/png; mode=16bit</Format> | ||
<Format>image/png; mode=8bit</Format> | ||
<Format>image/png; mode=1bit</Format> | ||
<Format>application/dxf</Format> | ||
<DCPType> | ||
<HTTP> | ||
<Get> | ||
<OnlineResource xlink:type="simple" xlink:href="http://localhost/wms/test_project?" xmlns:xlink="http://www.w3.org/1999/xlink"/> | ||
</Get> | ||
</HTTP> | ||
</DCPType> | ||
</GetMap> | ||
<GetFeatureInfo> | ||
<Format>text/plain</Format> | ||
<Format>text/html</Format> | ||
<Format>text/xml</Format> | ||
<Format>application/vnd.ogc.gml</Format> | ||
<Format>application/vnd.ogc.gml/3.1.1</Format> | ||
<Format>application/json</Format> | ||
<Format>application/geo+json</Format> | ||
<DCPType> | ||
<HTTP> | ||
<Get> | ||
<OnlineResource xlink:type="simple" xlink:href="http://localhost/wms/test_project?" xmlns:xlink="http://www.w3.org/1999/xlink"/> | ||
</Get> | ||
</HTTP> | ||
</DCPType> | ||
</GetFeatureInfo> | ||
<sld:GetLegendGraphic> | ||
<Format>image/jpeg</Format> | ||
<Format>image/png</Format> | ||
<Format>application/json</Format> | ||
<DCPType> | ||
<HTTP> | ||
<Get> | ||
<OnlineResource xlink:type="simple" xlink:href="http://localhost/wms/test_project?" xmlns:xlink="http://www.w3.org/1999/xlink"/> | ||
</Get> | ||
</HTTP> | ||
</DCPType> | ||
</sld:GetLegendGraphic> | ||
<sld:DescribeLayer> | ||
<Format>text/xml</Format> | ||
<DCPType> | ||
<HTTP> | ||
<Get> | ||
<OnlineResource xlink:type="simple" xlink:href="http://localhost/wms/test_project?" xmlns:xlink="http://www.w3.org/1999/xlink"/> | ||
</Get> | ||
</HTTP> | ||
</DCPType> | ||
</sld:DescribeLayer> | ||
<qgs:GetStyles> | ||
<Format>text/xml</Format> | ||
<DCPType> | ||
<HTTP> | ||
<Get> | ||
<OnlineResource xlink:type="simple" xlink:href="http://localhost/wms/test_project?" xmlns:xlink="http://www.w3.org/1999/xlink"/> | ||
</Get> | ||
</HTTP> | ||
</DCPType> | ||
</qgs:GetStyles> | ||
</Request> | ||
<Exception> | ||
<Format>XML</Format> | ||
</Exception> | ||
<sld:UserDefinedSymbolization SupportSLD="1" RemoteWCS="0" UserLayer="0" InlineFeature="0" RemoteWFS="0" UserStyle="1"/> | ||
<Layer queryable="1"> | ||
<Name>QGIS Test Project</Name> | ||
<Title>QGIS TestProject</Title> | ||
<Abstract><![CDATA[Some UTF8 text èòù]]></Abstract> | ||
<KeywordList> | ||
<Keyword vocabulary="ISO">infoMapAccessService</Keyword> | ||
</KeywordList> | ||
<CRS>CRS:84</CRS> | ||
<CRS>EPSG:4326</CRS> | ||
<CRS>EPSG:3857</CRS> | ||
<EX_GeographicBoundingBox> | ||
<westBoundLongitude>8.203154</westBoundLongitude> | ||
<eastBoundLongitude>8.204165</eastBoundLongitude> | ||
<southBoundLatitude>44.901236</southBoundLatitude> | ||
<northBoundLatitude>44.901599</northBoundLatitude> | ||
</EX_GeographicBoundingBox> | ||
<BoundingBox maxy="5606043.446" maxx="913283.462" miny="5605986.581" CRS="EPSG:3857" minx="913170.942"/> | ||
<BoundingBox maxy="8.204165" maxx="44.901599" miny="8.203154" CRS="EPSG:4326" minx="44.901236"/> | ||
<Layer queryable="1"> | ||
<Name>layer_with_short_name</Name> | ||
<Title>A Layer with a short name</Title> | ||
<Abstract>A Layer with an abstract</Abstract> | ||
<CRS>CRS:84</CRS> | ||
<CRS>EPSG:4326</CRS> | ||
<CRS>EPSG:3857</CRS> | ||
<EX_GeographicBoundingBox> | ||
<westBoundLongitude>8.203459</westBoundLongitude> | ||
<eastBoundLongitude>8.203547</eastBoundLongitude> | ||
<southBoundLatitude>44.901394</southBoundLatitude> | ||
<northBoundLatitude>44.901483</northBoundLatitude> | ||
</EX_GeographicBoundingBox> | ||
<BoundingBox maxy="5606025.238" maxx="913214.675" miny="5606011.456" CRS="EPSG:3857" minx="913204.912"/> | ||
<BoundingBox maxy="8.203547" maxx="44.901483" miny="8.203459" CRS="EPSG:4326" minx="44.901394"/> | ||
<Style> | ||
<Name>default</Name> | ||
<Title>default</Title> | ||
<LegendURL> | ||
<Format>image/png</Format> | ||
<OnlineResource xlink:type="simple" xlink:href="http://localhost/wms/test_project?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetLegendGraphic&LAYER=layer_with_short_name&FORMAT=image/png&STYLE=default&SLD_VERSION=1.1.0" xmlns:xlink="http://www.w3.org/1999/xlink"/> | ||
</LegendURL> | ||
</Style> | ||
<MetadataURL type="FGDC:1998"> | ||
<Format>text/plain</Format> | ||
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://my.other.url"/> | ||
</MetadataURL> | ||
<MetadataURL type="ISO19115:2003"> | ||
<Format>text/xml</Format> | ||
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://some.data.com"/> | ||
</MetadataURL> | ||
</Layer> | ||
<Layer queryable="1"> | ||
<Name>landsat</Name> | ||
<Title>landsat</Title> | ||
<CRS>CRS:84</CRS> | ||
<CRS>EPSG:4326</CRS> | ||
<CRS>EPSG:3857</CRS> | ||
<EX_GeographicBoundingBox> | ||
<westBoundLongitude>17.924273</westBoundLongitude> | ||
<eastBoundLongitude>18.045658</eastBoundLongitude> | ||
<southBoundLatitude>30.151856</southBoundLatitude> | ||
<northBoundLatitude>30.257289</northBoundLatitude> | ||
</EX_GeographicBoundingBox> | ||
<BoundingBox maxy="3536664.948" maxx="2008833.414" miny="3523084.517" CRS="EPSG:3857" minx="1995320.991"/> | ||
<BoundingBox maxy="18.045658" maxx="30.257289" miny="17.924273" CRS="EPSG:4326" minx="30.151856"/> | ||
<Style> | ||
<Name>default</Name> | ||
<Title>default</Title> | ||
<LegendURL> | ||
<Format>image/png</Format> | ||
<OnlineResource xlink:type="simple" xlink:href="http://localhost/wms/test_project?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetLegendGraphic&LAYER=landsat&FORMAT=image/png&STYLE=default&SLD_VERSION=1.1.0" xmlns:xlink="http://www.w3.org/1999/xlink"/> | ||
</LegendURL> | ||
</Style> | ||
</Layer> | ||
<Layer queryable="1"> | ||
<Name>testlayer èé</Name> | ||
<Title>A test vector layer</Title> | ||
<Abstract>A test vector layer with unicode òà</Abstract> | ||
<CRS>CRS:84</CRS> | ||
<CRS>EPSG:4326</CRS> | ||
<CRS>EPSG:3857</CRS> | ||
<EX_GeographicBoundingBox> | ||
<westBoundLongitude>8.203459</westBoundLongitude> | ||
<eastBoundLongitude>8.203547</eastBoundLongitude> | ||
<southBoundLatitude>44.901394</southBoundLatitude> | ||
<northBoundLatitude>44.901483</northBoundLatitude> | ||
</EX_GeographicBoundingBox> | ||
<BoundingBox maxy="5606025.238" maxx="913214.675" miny="5606011.456" CRS="EPSG:3857" minx="913204.912"/> | ||
<BoundingBox maxy="8.203547" maxx="44.901483" miny="8.203459" CRS="EPSG:4326" minx="44.901394"/> | ||
<Style> | ||
<Name>default</Name> | ||
<Title>default</Title> | ||
<LegendURL> | ||
<Format>image/png</Format> | ||
<OnlineResource xlink:type="simple" xlink:href="http://localhost/wms/test_project?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetLegendGraphic&LAYER=testlayer èé&FORMAT=image/png&STYLE=default&SLD_VERSION=1.1.0" xmlns:xlink="http://www.w3.org/1999/xlink"/> | ||
</LegendURL> | ||
</Style> | ||
</Layer> | ||
<Layer queryable="1"> | ||
<Name>fields_alias</Name> | ||
<Title>A test vector layer</Title> | ||
<Abstract>A test vector layer with unicode òà</Abstract> | ||
<CRS>CRS:84</CRS> | ||
<CRS>EPSG:4326</CRS> | ||
<CRS>EPSG:3857</CRS> | ||
<EX_GeographicBoundingBox> | ||
<westBoundLongitude>8.203459</westBoundLongitude> | ||
<eastBoundLongitude>8.203547</eastBoundLongitude> | ||
<southBoundLatitude>44.901394</southBoundLatitude> | ||
<northBoundLatitude>44.901483</northBoundLatitude> | ||
</EX_GeographicBoundingBox> | ||
<BoundingBox maxy="5606025.238" maxx="913214.675" miny="5606011.456" CRS="EPSG:3857" minx="913204.912"/> | ||
<BoundingBox maxy="8.203547" maxx="44.901483" miny="8.203459" CRS="EPSG:4326" minx="44.901394"/> | ||
<Style> | ||
<Name>default</Name> | ||
<Title>default</Title> | ||
<LegendURL> | ||
<Format>image/png</Format> | ||
<OnlineResource xlink:type="simple" xlink:href="http://localhost/wms/test_project?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetLegendGraphic&LAYER=fields_alias&FORMAT=image/png&STYLE=default&SLD_VERSION=1.1.0" xmlns:xlink="http://www.w3.org/1999/xlink"/> | ||
</LegendURL> | ||
</Style> | ||
</Layer> | ||
<Layer queryable="1"> | ||
<Name>exclude_attribute</Name> | ||
<Title>A test vector layer</Title> | ||
<Abstract>A test vector layer with unicode òà</Abstract> | ||
<CRS>CRS:84</CRS> | ||
<CRS>EPSG:4326</CRS> | ||
<CRS>EPSG:3857</CRS> | ||
<EX_GeographicBoundingBox> | ||
<westBoundLongitude>8.203459</westBoundLongitude> | ||
<eastBoundLongitude>8.203547</eastBoundLongitude> | ||
<southBoundLatitude>44.901394</southBoundLatitude> | ||
<northBoundLatitude>44.901483</northBoundLatitude> | ||
</EX_GeographicBoundingBox> | ||
<BoundingBox maxy="5606025.238" maxx="913214.675" miny="5606011.456" CRS="EPSG:3857" minx="913204.912"/> | ||
<BoundingBox maxy="8.203547" maxx="44.901483" miny="8.203459" CRS="EPSG:4326" minx="44.901394"/> | ||
<Style> | ||
<Name>default</Name> | ||
<Title>default</Title> | ||
<LegendURL> | ||
<Format>image/png</Format> | ||
<OnlineResource xlink:type="simple" xlink:href="http://localhost/wms/test_project?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetLegendGraphic&LAYER=exclude_attribute&FORMAT=image/png&STYLE=default&SLD_VERSION=1.1.0" xmlns:xlink="http://www.w3.org/1999/xlink"/> | ||
</LegendURL> | ||
</Style> | ||
</Layer> | ||
<Layer queryable="1"> | ||
<Name>group_name</Name> | ||
<Title>Group title</Title> | ||
<Abstract>Group abstract</Abstract> | ||
<CRS>CRS:84</CRS> | ||
<CRS>EPSG:4326</CRS> | ||
<CRS>EPSG:3857</CRS> | ||
<EX_GeographicBoundingBox> | ||
<westBoundLongitude>8.203459</westBoundLongitude> | ||
<eastBoundLongitude>8.203548</eastBoundLongitude> | ||
<southBoundLatitude>44.901394</southBoundLatitude> | ||
<northBoundLatitude>44.901483</northBoundLatitude> | ||
</EX_GeographicBoundingBox> | ||
<BoundingBox maxy="5606025.239" maxx="913214.676" miny="5606011.456" CRS="EPSG:3857" minx="913204.911"/> | ||
<BoundingBox maxy="8.203548" maxx="44.901483" miny="8.203459" CRS="EPSG:4326" minx="44.901394"/> | ||
<Layer queryable="1"> | ||
<Name>testlayer2</Name> | ||
<Title>testlayer2</Title> | ||
<CRS>CRS:84</CRS> | ||
<CRS>EPSG:4326</CRS> | ||
<CRS>EPSG:3857</CRS> | ||
<EX_GeographicBoundingBox> | ||
<westBoundLongitude>8.203459</westBoundLongitude> | ||
<eastBoundLongitude>8.203547</eastBoundLongitude> | ||
<southBoundLatitude>44.901394</southBoundLatitude> | ||
<northBoundLatitude>44.901483</northBoundLatitude> | ||
</EX_GeographicBoundingBox> | ||
<BoundingBox maxy="5606025.238" maxx="913214.675" miny="5606011.456" CRS="EPSG:3857" minx="913204.912"/> | ||
<BoundingBox maxy="8.203547" maxx="44.901483" miny="8.203459" CRS="EPSG:4326" minx="44.901394"/> | ||
<Style> | ||
<Name>default</Name> | ||
<Title>default</Title> | ||
<LegendURL> | ||
<Format>image/png</Format> | ||
<OnlineResource xlink:type="simple" xlink:href="http://localhost/wms/test_project?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetLegendGraphic&LAYER=testlayer2&FORMAT=image/png&STYLE=default&SLD_VERSION=1.1.0" xmlns:xlink="http://www.w3.org/1999/xlink"/> | ||
</LegendURL> | ||
</Style> | ||
</Layer> | ||
</Layer> | ||
<Layer queryable="0"> | ||
<Name>groupwithoutshortname</Name> | ||
<Title>groupwithoutshortname</Title> | ||
<CRS>CRS:84</CRS> | ||
<CRS>EPSG:4326</CRS> | ||
<CRS>EPSG:3857</CRS> | ||
<EX_GeographicBoundingBox> | ||
<westBoundLongitude>8.203459</westBoundLongitude> | ||
<eastBoundLongitude>8.203548</eastBoundLongitude> | ||
<southBoundLatitude>44.901394</southBoundLatitude> | ||
<northBoundLatitude>44.901483</northBoundLatitude> | ||
</EX_GeographicBoundingBox> | ||
<BoundingBox maxy="5606025.239" maxx="913214.676" miny="5606011.456" CRS="EPSG:3857" minx="913204.911"/> | ||
<BoundingBox maxy="8.203548" maxx="44.901483" miny="8.203459" CRS="EPSG:4326" minx="44.901394"/> | ||
<Layer queryable="0"> | ||
<Name>testlayer3</Name> | ||
<Title>testlayer3</Title> | ||
<CRS>CRS:84</CRS> | ||
<CRS>EPSG:4326</CRS> | ||
<CRS>EPSG:3857</CRS> | ||
<EX_GeographicBoundingBox> | ||
<westBoundLongitude>8.203459</westBoundLongitude> | ||
<eastBoundLongitude>8.203547</eastBoundLongitude> | ||
<southBoundLatitude>44.901394</southBoundLatitude> | ||
<northBoundLatitude>44.901483</northBoundLatitude> | ||
</EX_GeographicBoundingBox> | ||
<BoundingBox maxy="5606025.238" maxx="913214.675" miny="5606011.456" CRS="EPSG:3857" minx="913204.912"/> | ||
<BoundingBox maxy="8.203547" maxx="44.901483" miny="8.203459" CRS="EPSG:4326" minx="44.901394"/> | ||
<Style> | ||
<Name>default</Name> | ||
<Title>default</Title> | ||
<LegendURL> | ||
<Format>image/png</Format> | ||
<OnlineResource xlink:type="simple" xlink:href="http://localhost/wms/test_project?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetLegendGraphic&LAYER=testlayer3&FORMAT=image/png&STYLE=default&SLD_VERSION=1.1.0" xmlns:xlink="http://www.w3.org/1999/xlink"/> | ||
</LegendURL> | ||
</Style> | ||
</Layer> | ||
</Layer> | ||
</Layer> | ||
</Capability> | ||
</WMS_Capabilities> |