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

Allow setting URL encoding/decoding to RFC 3986 #11513

Open
wants to merge 8 commits into
base: 4.8.x
Choose a base branch
from
Open

Conversation

graemerocher
Copy link
Contributor

@graemerocher graemerocher commented Jan 16, 2025

Introduce new UrlEncodingKind enum that can be configured from the client configuration for encoding and the router configuration for decoding adapting the URL encoding/decoding to RFC-3986.

Micronaut 5 should likely default to RFC-3986 for everything except form decoding.

Fixes #11434
Fixes #10564

This resolves almost everything, but there appear to be issues with Netty's parameters() method of QueryStringDecoder. Which seems to be designed for decoding application/x-www-form-urlencoded not RFC-3986.

@graemerocher graemerocher added the type: enhancement New feature or request label Jan 16, 2025
@graemerocher
Copy link
Contributor Author

still working on this PR, since trying to address decoding

def result = client.toBlocking().retrieve(req)

expect:"resolved values should using RFC-3986 decoding"
// TODO: investigate why Netty QueryStringDecoder.parameters() doesn't respect RFC-3986
Copy link
Contributor Author

Choose a reason for hiding this comment

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

According to netty/netty@270e9d6 the decoding of + into space was supposed to be fixed, but it doesn't seem to be fixed for the parameters() method of QueryStringDecoder. We need to investigate if this is a bug in Netty or by design.

@graemerocher graemerocher changed the title Allow setting URL encoding to RFC 3986 Allow setting URL encoding/decoding to RFC 3986 Jan 17, 2025
@graemerocher graemerocher requested a review from yawkat January 17, 2025 15:49
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
68.8% Coverage on New Code (required ≥ 70%)
1 New Critical Issues (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
Status: Ready for Review
3 participants