-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Raise an error if GetCapabilities requests don't return XML #861
Merged
geographika
merged 8 commits into
geopython:master
from
geographika:getcapabilities-errors
Oct 19, 2024
Merged
Raise an error if GetCapabilities requests don't return XML #861
geographika
merged 8 commits into
geopython:master
from
geographika:getcapabilities-errors
Oct 19, 2024
Conversation
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 Pull Request has been inactive for 90 days. In order to manage maintenance burden, it will be automatically closed in 7 days. |
geographika
force-pushed
the
getcapabilities-errors
branch
from
October 6, 2024 10:22
7890a58
to
58f7a29
Compare
Rebased against main - all tests passing. |
Failing CI is due to not being able to submit to coveralls. Seems unrelated to this change.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently if a GetCapabilities request doesn't return an XML document it raises cryptic error messages such as:
This pull request checks to see if the server response
Content-Type
is XML, and if not it raises an exception that includes the URL and response. If the response is HTML it attempts to parse the body of the document to use as the error message. This is particularly useful when working with MapServer which returns errors intext/html
format. E.g.Currently any
Content-Type
which has any match/partial match against the following list will be considered as XML:['text/xml', 'application/xml', 'application/vnd.ogc.wms_xml']
It may be better to just check for
xml
in case there are types I've missed?In addition the
strip_bom
was only previously used for WMS GetCapabilities requests - this change means it is applied to all service types (WFS, SOS, WCS, WMTS).