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

Improve handling of broken accept headers in MediaTypeHeaderDelegate #36160

Conversation

thomasdarimont
Copy link
Contributor

Previously, a "broken" MIME-type in an access header could trigger an StringIndexOutOfBoundsException during MediaTypeHeaderDelegate.parse(..) instead of the more suitable IllegalArgumentException.

Example: "Accept: x; /x"

This PR now throws an IllegalArgumentException in case of a broken MIME-type like in the example.

Fixes #36159

@quarkus-bot
Copy link

quarkus-bot bot commented Sep 26, 2023

Thanks for your pull request!

The title of your pull request does not follow our editorial rules. Could you have a look?

  • title should preferably start with an uppercase character (if it makes sense!)
  • title should not start with chore/docs/feat/fix/refactor but be a proper sentence

This message is automatically generated by a bot.

…gate.parse(..) within resteasy-reactive

Previously, a "broken" MIME-type in an access header could trigger an StringIndexOutOfBoundsException during MediaTypeHeaderDelegate.parse(..) instead of the more suitable IllegalArgumentException.

Example: "Accept: x; /x"

This PR now throws an IllegalArgumentException in case of a broken MIME-type like in the example.

Fixes quarkusio#36159
@thomasdarimont thomasdarimont force-pushed the issue/GH-36159-Gracefully-handle-broken-accept-header-resteasy-reactive branch from fd136a4 to 84d6c5d Compare September 26, 2023 11:32
@thomasdarimont thomasdarimont changed the title fix: Improve handling of broken accept headers in MediaTypeHeaderDelegate.parse(..) Improve handling of broken accept headers in MediaTypeHeaderDelegate.parse(..) Sep 26, 2023
Copy link
Contributor

@geoand geoand left a comment

Choose a reason for hiding this comment

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

Makes sense, thanks a lot!

@geoand geoand changed the title Improve handling of broken accept headers in MediaTypeHeaderDelegate.parse(..) Improve handling of broken accept headers in MediaTypeHeaderDelegate Sep 26, 2023
@geoand geoand added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Sep 26, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented Sep 26, 2023

Failing Jobs - Building 84d6c5d

Status Name Step Failures Logs Raw logs Build scan
✔️ Gradle Tests - JDK 11
Gradle Tests - JDK 11 Windows Build Failures Logs Raw logs

Full information is available in the Build summary check run.

Failures

⚙️ Gradle Tests - JDK 11 Windows #

- Failing: integration-tests/gradle 

📦 integration-tests/gradle

io.quarkus.gradle.builder.QuarkusModelBuilderTest.shouldLoadMultiModuleTestModel line 66 - More details - Source on GitHub

org.gradle.tooling.BuildException: Could not run build action using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-8.3-bin.zip'.
	at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:51)
	at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:29)

io.quarkus.gradle.builder.QuarkusModelBuilderTest.shouldLoadMultiModuleDevModel line 100 - More details - Source on GitHub

org.gradle.tooling.BuildException: Could not run build action using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-8.3-bin.zip'.
	at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:51)
	at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:29)

@geoand geoand merged commit 8a360ba into quarkusio:main Sep 26, 2023
43 of 44 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.5 - main milestone Sep 26, 2023
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label Sep 26, 2023
@gsmet gsmet modified the milestones: 3.5 - main, 3.4.2 Oct 3, 2023
@aloubyansky aloubyansky modified the milestones: 3.4.2, 3.2.8.Final Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resteasy Reactive incorrectly handles broken accept header
5 participants