Open geographika opened 2 years ago
Looks like the content type can be checked here:
print(u.info()['Content-Type']) # Good: text/xml; charset=UTF-8 # Bad: text/html
If this should always return XML then perhaps an error could be thrown here with the raw server response if any other content-type is returned?
When connecting to MapServer to get server capabilities, any resulting errors are reported in HTML.
So for example:
Can throw the following cryptic error:
Once a capabilities request is returned in the following code, we could check if the returned output was HTML or XML, and if it was HTML then report an error and throw an exception:
https://github.com/geopython/OWSLib/blob/a6105226f1c8466c3b1e9998747d0dbf01434129/owslib/map/wms130.py#L77-L81
However maybe it is better to handle this in
WMSCapabilitiesReader
directly?