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

[3.x] Fix bug with empty Accept header #7535

Merged

Conversation

tjquinno
Copy link
Member

@tjquinno tjquinno commented Sep 6, 2023

Description

Resolves #7311

If a request for the OpenAPI endpoint specifies an empty Accept header, then the code would attempt to modify the request headers by adding a "default" Accept. But the request headers are read-only at that point, so the attempt would thrown an exception.

This PR changes that flow so it simply returns the default media type for OpenAPI content if the incoming Accept is empty.

Includes a test that reproduces the original problem and verifies the fix.

Documentation

No doc impact.

@tjquinno tjquinno self-assigned this Sep 6, 2023
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Sep 6, 2023
@tjquinno tjquinno changed the title Fix bug with empty Accept header [3.x] Fix bug with empty Accept header Sep 6, 2023
@barchetta barchetta added the 3.x Issues for 3.x version branch label Sep 7, 2023
Copy link
Member

@klustria klustria left a comment

Choose a reason for hiding this comment

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

LGTM

@tjquinno tjquinno merged commit 7a7ac64 into helidon-io:helidon-3.x Sep 11, 2023
12 checks passed
@tjquinno tjquinno deleted the openapi-empty-accept-fix-3.x branch September 11, 2023 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Issues for 3.x version branch OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3.x UnsupportedOperationException thrown when request sent to openapi endpoint with no "Accept" header
3 participants