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
@VerKWer VerKWer force-pushed the 8566-uri-query-params branch from c0b6dba to 1de9b80 Compare April 4, 2024 11:09
@Verdent Verdent requested review from Verdent and tomas-langer April 4, 2024 11:36
Copy link

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
The following contributors of this PR have not signed the OCA:

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.

@oracle-contributor-agreement oracle-contributor-agreement bot added OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. and removed OCA Verified All contributors have signed the Oracle Contributor Agreement. labels Sep 23, 2024
@VerKWer VerKWer force-pushed the 8566-uri-query-params branch from 4b89c88 to 1de9b80 Compare September 23, 2024 11:22
Copy link

Thank you for signing the OCA.

@oracle-contributor-agreement oracle-contributor-agreement bot added OCA Verified All contributors have signed the Oracle Contributor Agreement. and removed OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. labels Sep 23, 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.
@VerKWer VerKWer force-pushed the 8566-uri-query-params branch from 1de9b80 to 272c882 Compare September 23, 2024 11:23
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