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

Requests without an Accept header are not accepted #498

Merged
merged 1 commit into from
May 26, 2022

Conversation

pedroigor
Copy link
Contributor

Closes #497

@@ -264,6 +264,10 @@ Optional<String> getBestMatchingMediaType(Stream<String> acceptHeaders) {
}
});

if (tupleList.isEmpty()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be simpler and more straightforward to change the condition on line 196 (if (acceptHeaders == null)) to also accept acceptHeaders.count() == 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me, I thought that method was the best to decide about the best matching media type and it is also easier to test.

Up to you ...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, ok I didn't realize it's more suitable for testing. Let's keep it this way then, thanks!

@jmartisk jmartisk merged commit be478e8 into smallrye:main May 26, 2022
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.

Requests without an Accept header are not accepted
2 participants