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

ResteasyReactiveRequestContext.setRequestUri not supporting query parameters #28555

Closed
spike83 opened this issue Oct 13, 2022 · 3 comments · Fixed by #28595
Closed

ResteasyReactiveRequestContext.setRequestUri not supporting query parameters #28555

spike83 opened this issue Oct 13, 2022 · 3 comments · Fixed by #28595

Comments

@spike83
Copy link
Contributor

spike83 commented Oct 13, 2022

Migrating a project form resteasy to resteasy-reactive I found that ResteasyReactiveRequestContext.setRequestUri is not applying the query parameters.

public ResteasyReactiveRequestContext setRequestUri(URI requestURI) {
this.path = requestURI.getPath();
this.authority = requestURI.getRawAuthority();
this.scheme = requestURI.getScheme();
// FIXME: it's possible we may have to also update the query part
// invalidate those
this.uriInfo = null;
this.absoluteUri = null;
return this;
}

We have a ContainerRequestFilter which has to modify some paths and query parameters. When doing something like below, the subject query parameter is not set at the end.

public class ContextFilter implements ContainerRequestFilter {
    public void filter(ContainerRequestContext requestContext) throws IOException {
                UriBuilder builder = requestContext.getUriInfo().getRequestUriBuilder();
                builder.replacePath("/newpath");
                builder.replaceQueryParam("subject", "test");
                uri = builder.build();
                requestContext.setRequestUri(uri);

Is there a workaround or a better way doing this?

@geoand
Copy link
Contributor

geoand commented Oct 13, 2022

Interesting. There doesn't seem to be workaround currently.

Do you mind attaching a sample project that we can test any potential fixes against? This will help us speed up the process of providing a fix that we can backport into some 2.13.z release.

Thanks

@quarkus-bot
Copy link

quarkus-bot bot commented Oct 13, 2022

/cc @FroMage, @stuartwdouglas

@spike83
Copy link
Contributor Author

spike83 commented Oct 14, 2022

Here is a minimal reproducer.
quarkus-28555.zip

geoand added a commit to geoand/quarkus that referenced this issue Oct 14, 2022
geoand added a commit to geoand/quarkus that referenced this issue Oct 14, 2022
gsmet added a commit that referenced this issue Oct 15, 2022
Allow overriding query parameters from a ContainerRequestFilter
@quarkus-bot quarkus-bot bot added this to the 2.14 - main milestone Oct 15, 2022
igorregis pushed a commit to igorregis/quarkus that referenced this issue Oct 16, 2022
igorregis pushed a commit to igorregis/quarkus that referenced this issue Oct 16, 2022
igorregis pushed a commit to igorregis/quarkus that referenced this issue Oct 16, 2022
igorregis pushed a commit to igorregis/quarkus that referenced this issue Oct 17, 2022
Liuigi pushed a commit to Liuigi/quarkus that referenced this issue Oct 17, 2022
@gsmet gsmet modified the milestones: 2.14 - main, 2.13.3.Final Oct 17, 2022
gsmet pushed a commit to gsmet/quarkus that referenced this issue Oct 17, 2022
tmihalac pushed a commit to tmihalac/quarkus that referenced this issue Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants