-
Notifications
You must be signed in to change notification settings - Fork 115
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
Deal with (optional) headers #39
Comments
@MichielDeMey I've had a brief discussion with my colleagues about this and we feel that making the header matching less strict would complicate the rules around response/request pair matching. I think that being specific with the headers allows you to get a more predictable response from Drakov. |
Makes sense, however, does Drakov currently support use-case 1 (example suplied)? In that case I can define a response without an active header and treat that as the default response. |
Yep, absolutely. We have a test Blueprint file we test against to ensure behaviours against headers: Let me know if you have any trouble with the headers 👍 |
Just tested this, works as expected. :) |
Just a quick thought, but would it not make sense to at least return something besides a 404? Technically the resource IS found, it's just the request was incorrect... |
Returning something other than a 404 would be a lot more useful, simply getting 404's back doesn't provide any useful information about what is actually wrong. |
Let's try and start a discussion about (optional) headers.
In my use-case, you have to specify your language through the
Accept-Language
header and depending on the selected language, the response is different.One thing I noticed however is that drakov will return a
404
if the header doesn't match the one specified in the blueprint. However, in my API theAccept-Language
header is optional and will default toen-US
if undefined.Let's discuss two things:
The text was updated successfully, but these errors were encountered: