nmos-testing
nmos-testing copied to clipboard
Test cases for POST etc. should fail 3xx responses
Per IS-04 docs, URLs: Approach to Trailing Slashes, POST
requests MUST be issued by Clients without a trailing slash and Servers implementing the APIs MUST correctly interpret such requests. Although the wording could be clearer as always, I believe this means Servers MUST NOT respond with a 3xx
redirection.
I wonder if IS-04-02 test_30 would originally have caught this issue for the Registration API /health
endpoint, but doesn't any longer because do_request
was updated to allow redirects? The same issue may be affecting other API test cases for POST
, DELETE
, PATCH
, etc. I remember we checked and updated all such test cases to use the endpoints without a trailing slash.
https://docs.python-requests.org/en/master/user/quickstart/#redirection-and-history says that we'd need to explicitly pass allow_redirects
to get the behaviour we need.
@jonathan-r-thorpe, this would be another appropriate test on clients as well, that they don't send POST
, PATCH
, DELETE
, etc. with a trailing slash on any API.
AFAIK the Flask endpoints on the current implementation of the mock Registry and mock Node will reject trailing slashes with a 404 error, so should be covered already.