Skip to content
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

bad exception parsing in owslib.util.openURL #877

Open
mat-kos opened this issue Jun 19, 2023 · 1 comment
Open

bad exception parsing in owslib.util.openURL #877

mat-kos opened this issue Jun 19, 2023 · 1 comment
Labels

Comments

@mat-kos
Copy link

mat-kos commented Jun 19, 2023

# check for service exceptions without the http header set if 'Content-Type' in req.headers and \ req.headers['Content-Type'] in ['text/xml', 'application/xml', 'application/vnd.ogc.se_xml']: # just in case 400 headers were not set, going to have to read the xml to see if it's an exception report.

In the code example provided above (util.openURL function), Content-Type value is checked only against MIME type, so errors with content types like "text/xml;charset=utf-8" won't be handled.

I think this check would be better:
re.sub(";.*$", "", req.headers['Content-Type') in ['text/xml', 'application/xml', 'application/vnd.ogc.se_xml']:

Copy link

github-actions bot commented Oct 6, 2024

This Issue has been inactive for 90 days. In order to manage maintenance burden, it will be automatically closed in 7 days.

@github-actions github-actions bot added the stale label Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant