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

Accept headers are too lenient with errors #67

Open
bergmark opened this issue Sep 19, 2014 · 4 comments
Open

Accept headers are too lenient with errors #67

bergmark opened this issue Sep 19, 2014 · 4 comments

Comments

@bergmark
Copy link
Member

This is a continuation of #65 that won't make it into that PR.

If you have a resource declaring fileO . someO . jsonE . someE and request it with Accept: application/octet-stream you should get an error, the header should be Accept: application/octetstream,text/json or equivalent. Otherwise you may get a response in an unexpected format.

@hesselink
Copy link
Member

Just to clarify: we currently check the accept headers against the provided output types always, but we only check them against the provided error types if an actual error occurs. This means you can have working code, until an error occurs. Then, instead of the error, you'll see that 'unsupported type'.

@bergmark
Copy link
Member Author

I wasn't able to reproduce that part, it just responds with json when an error occurs even though it's not in the accept header

@hesselink
Copy link
Member

Ah, that makes sense. It just picks something to be able to give the original error.

@bergmark
Copy link
Member Author

Btw, this is probably low prio since generated clients in #65 will specify both output and error in the accept header if needed.

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

No branches or pull requests

2 participants