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

Reject requests with unsupported versions #313

Merged
merged 4 commits into from
Feb 17, 2021

Conversation

jisantuc
Copy link
Contributor

@jisantuc jisantuc commented Feb 15, 2021

Overview

This PR updates the version param validation logic to take a param of which versions are supported. As the validation logic was written before, it was happy to take any string as the version param, which led unexpected successes for versions that don't match
what the server is actually capable of.

Checklist

  • Description of PR is in an appropriate section of the CHANGELOG and grouped with similar changes if possible

Demo

$ http :9000 service==wmts request==getcapabilities acceptVersions==1.0.1,1.1.0,1.1.2
HTTP/1.1 400 Bad Request
Content-Length: 50
Content-Type: text/plain; charset=UTF-8
Date: Mon, 15 Feb 2021 21:24:31 GMT

No available version in 1.0.0: 1.0.1, 1.1.0, 1.1.2

$ http :9000 service==wmts request==getcapabilities version==900
HTTP/1.1 400 Bad Request
Content-Length: 76
Content-Type: text/plain; charset=UTF-8
Date: Mon, 15 Feb 2021 21:31:59 GMT

Parameter 'version' has an invalid value of '900'. Needs to be one of: 1.0.0

Testing Instructions

  • bring up ogc-example project
  • make some GetCapabilities requests as above for wcs, wms, and wmts services using supported versions (1.1.1, 1.3.0, and 1.0.0, respectively)
  • make similar requests for unsupported versions (anything else)
  • make similar requests with acceptedVersions set to a comma-separated list that includes the valid version -- this should work
  • make similar requests with acceptedVersions set to a comma-separated list that excludes the valid version -- this should give you a 400

Closes #307

@pomadchin pomadchin merged commit ce233d3 into develop Feb 17, 2021
@pomadchin pomadchin deleted the bugfix/js/dont-serve-unsupported-request-versions branch February 17, 2021 01:10
@pomadchin
Copy link
Member

Thanks! Looks good to me! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Successful response on unsupported versions for GetCapabilities request
2 participants