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

List available representations in 406 body #437

Merged
merged 1 commit into from Aug 19, 2020

Conversation

brackendawson
Copy link
Contributor

Becasue RFC7231 says we should.

fixes #434

Becasue RFC7231 says we should.
@brackendawson
Copy link
Contributor Author

I chose to not remove duplicates from available because this is the last thing in detectRoute() and therefore there should be none?

@brackendawson
Copy link
Contributor Author

Also was this supposed to test a 406 response?

func TestContentType406PlainJson(t *testing.T) {

@emicklei
Copy link
Owner

I chose to not remove duplicates from available because this is the last thing in detectRoute() and therefore there should be none?

please explain why not removing dups?

@brackendawson
Copy link
Contributor Author

brackendawson commented Jul 29, 2020

please explain why not removing dups?

Because the Accept header is the last thing checked in the router, a valid path should not contain any duplicate media types. If it did then a matching call would fail.

It does look like the sort of thing that would get missed if another switch was added to the router after Accept. I can add deduplication if you like? It is only exposed in the error case.

@emicklei emicklei merged commit d9ee3c6 into emicklei:master Aug 19, 2020
emicklei pushed a commit that referenced this pull request Aug 19, 2020
Becasue RFC7231 says we should.
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.

Acceptable representations not listed in body of '406: Not Acceptable' responses
2 participants