You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I didn't make the request with the correct version Accept header, but I'm getting a successful 200 response. Is this a bug, or have I misunderstood how the strict: true, cascade: false config settings are supposed to work?
The text was updated successfully, but these errors were encountered:
elliotlarson
changed the title
Versioning accept header strict setting appears to not work in this case
Versioning accept header strict/cascade settings appears to not work in this case
Jul 30, 2015
I believe your logic is correct. Without a valid Accept header you have no matching version and it should fail with a 406 as long as strict: true. Ot at least the documentation says so. Lets get to the bottom of this, try writing a test that reproduces it on Grape's HEAD?
Okay, I created a pull request for this: #1101 At least, this seemed fairly straight forward to test and fix. It looks like if the accept header was a media type, it was failing to catch the missing version and return a 406.
If I have this config for versioning...
then this should require that I pass the appropriate
Accept
request header to get a valid200
response.This request should work:
... and it does, returning a successful
200
response.But, not passing the correct Accept header should result in an error. For example, this request:
... fails with a
406
response as expected.However, this request returns a successful
200
API response, which is unexpected:I didn't make the request with the correct version
Accept
header, but I'm getting a successful200
response. Is this a bug, or have I misunderstood how thestrict: true, cascade: false
config settings are supposed to work?The text was updated successfully, but these errors were encountered: