Skip to content

Make sure query params are correct when set from ContainerRequestFilter #49065

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

Merged
merged 1 commit into from
Jul 23, 2025

Conversation

geoand
Copy link
Contributor

@geoand geoand commented Jul 23, 2025

@geoand geoand requested a review from gsmet July 23, 2025 10:44
@gsmet gsmet added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Jul 23, 2025
Copy link
Member

@FroMage FroMage left a comment

Choose a reason for hiding this comment

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

I fail to spot where the test actually tests the query parameters :-/

@geoand
Copy link
Contributor Author

geoand commented Jul 23, 2025

uriInfo.getRequestUri().getQuery(); in the change

Copy link

quarkus-bot bot commented Jul 23, 2025

Status for workflow Quarkus CI

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

✅ 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.

@geoand geoand merged commit 93350ee into quarkusio:main Jul 23, 2025
52 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.26 - main milestone Jul 23, 2025
@quarkus-bot quarkus-bot bot added kind/bugfix and removed triage/waiting-for-ci Ready to merge when CI successfully finishes labels Jul 23, 2025
builder.replacePath("/hello");
UriInfo originalUriInfo = requestContext.getUriInfo();
UriBuilder builder = originalUriInfo.getRequestUriBuilder();
builder.replacePath(originalUriInfo.getPath().contains("2") ? "/hello/2" : "/hello");
Copy link
Member

Choose a reason for hiding this comment

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

OH OK I see. I was thinking it's replacePath that we need to check, thinking this is where the original reporter added a path that included query parameters that we dropped.

But in fact we're using the builder to build a URI, which includes query parameters, and then later down we call setRequestUri with query param (that was the original bug).

I got confused, this is fine, thanks :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👌

@geoand geoand deleted the #49064 branch July 23, 2025 14:02
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.

UriInfo.getRequestUri loses query parameters if ContainerRequestContext.setRequestUri is called
3 participants