Skip to content

Sanitize URL for services #374

Closed
Closed
@tomkralidis

Description

@tomkralidis

As reported in Ref: cga-harvard/Hypermap-Registry#242, when OWSLib initializes OWS class instances the usual behaviour is to internally build a full GetCapabilities request via HTTP GET. We need to ensure that URLs passed with the basic service elements (service, version, request) are stripped of these elements so they are not passed twice when OWSLib interacts with the OWS.

Examples:

>>> from owslib.csw import CatalogueServiceWeb as csw
>>> c = csw('http://demo.pycsw.org/cite/csw')
>>> c.request
'http://demo.pycsw.org/cite/csw?version=2.0.2&request=GetCapabilities&service=CSW'
>>> c = csw('http://demo.pycsw.org/cite/csw?service=CSW&version=2.0.2&request=GetCapabilitiesd')
>>> c.request
'http://demo.pycsw.org/cite/csw?service=CSW&version=2.0.2&request=GetCapabilitiesd&version=2.0.2&request=GetCapabilities&service=CSW'
>>> from owslib.wms import WebMapService as wms
>>> w = wms('http://tepeserwery.pl/tileservice/wms.php/icrsptixwh?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities')
>>> w.request
'http://tepeserwery.pl/tileservice/wms.php/icrsptixwh?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities&service=WMS&request=GetCapabilities&version=1.1.1'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions