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

Throw IllegalArgumentException on failed URL decoding #46252

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

luisRubiera
Copy link

@luisRubiera luisRubiera commented Feb 13, 2025

Previously, URLUtils.decode threw a RuntimeException when encountering invalid percent-encoded values.

Now, it throws an IllegalArgumentException, ensuring that malformed input is correctly recognized as a client error.

Test coverage added for:

…RL decoding

Previously, URLUtils.decode threw a RuntimeException when encountering invalid percent-encoded values.

Now, it throws an IllegalArgumentException, ensuring that malformed input is correctly recognized as a client error.

Test coverage added for:
- Invalid percent encoding (e.g., %zz, %2)
- Gray-area invalid UTF-8 cases (e.g., %80)
- Properly encoded values (e.g., %20, form-encoded +, Japanese characters)

Fixes quarkusio#46197

This comment was marked as resolved.

@luisRubiera luisRubiera changed the title fix(independent-projects): throw IllegalArgumentException on failed URL decoding Throw IllegalArgumentException on failed URL decoding Feb 13, 2025
@geoand geoand added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Feb 13, 2025
@gsmet gsmet merged commit 6adbc78 into quarkusio:main Feb 13, 2025
49 checks passed
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label Feb 13, 2025
@quarkus-bot quarkus-bot bot added this to the 3.21 - main milestone Feb 13, 2025
@gsmet
Copy link
Member

gsmet commented Feb 13, 2025

Thanks for the contribution!

Copy link

quarkus-bot bot commented Feb 13, 2025

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit ed6ec4b.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.


Flaky tests - Develocity

⚙️ JVM Tests - JDK 17 Windows

📦 extensions/hibernate-orm/deployment

io.quarkus.hibernate.orm.applicationfieldaccess.PublicFieldAccessInheritanceTest.testFieldAccess - History

  • Expecting actual not to be null - java.lang.AssertionError
java.lang.AssertionError: 

Expecting actual not to be null
	at io.quarkus.hibernate.orm.applicationfieldaccess.PublicFieldAccessInheritanceTest$FieldAccessEnhancedDelegate$1.assertValue(PublicFieldAccessInheritanceTest.java:141)
	at io.quarkus.hibernate.orm.applicationfieldaccess.PublicFieldAccessInheritanceTest.doTestFieldAccess(PublicFieldAccessInheritanceTest.java:100)
	at io.quarkus.hibernate.orm.applicationfieldaccess.PublicFieldAccessInheritanceTest.testFieldAccess(PublicFieldAccessInheritanceTest.java:61)
	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
	at io.quarkus.test.QuarkusUnitTest.runExtensionMethod(QuarkusUnitTest.java:513)

📦 independent-projects/resteasy-reactive/server/vertx

org.jboss.resteasy.reactive.server.vertx.test.sse.SseServerTestCase.shouldNotTryToSendToClosedSink - History

  • 1 expectation failed. Response body doesn't match expectation. Expected: "true" Actual: false - java.lang.AssertionError
java.lang.AssertionError: 
1 expectation failed.
Response body doesn't match expectation.
Expected: "true"
  Actual: false

	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)

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.

RuntimeException thrown instead of IllegalArgumentException when failing to decode URL
3 participants