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

4.x: Fix resolved URI query params (#8566) #8614

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

VerKWer
Copy link
Contributor

@VerKWer VerKWer commented Apr 4, 2024

Description

The ClientRequestBase class did not properly resolve URIs when path- and query parameters were mixed. More specifically, the query parameters were stripped if the URI template was absolute.

The reason for this is that ClientRequestBase.resolveUri first resolves path parameters (creating a URI instance) and then calls ClientRequestBase.resolve against that URI. If the constructed URI is absolute, resolving against it clears query parameters.

Note that there are two ClientRequestBase.resolve methods: one for URIs and one for ClientUris. They behave differently regarding query parameters. The former mimics what URI.resolve does, which returns its argument if it is absolute; in particular, it removes any existing query parameters from the ClientUri if the argument is absolute. The latter method, however, leaves query parameters untouched. I'm not sure this difference is intentional but since these are public methods, their semantics shouldn't be changed. I added tests for this.

Resolves #8566

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Apr 4, 2024
The ClientRequestBase class did not properly resolve URIs when path- and
query parameters were mixed. More specifically, the query parameters
were stripped if the URI template was absolute.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WebClient - Uri resolved without query params when path and query params are mixed.
1 participant