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

PathParam containing "/" character are not well encoded as "%2F" when using reactive rest client with Stork #37713

Closed
Jojal opened this issue Dec 13, 2023 · 1 comment · Fixed by #37757
Labels
Milestone

Comments

@Jojal
Copy link

Jojal commented Dec 13, 2023

Describe the bug

I need to call an external API from my Quarkus backend.
For this example, the external api is like this : http://localhost:8081/api/v1/path/{pathParam}
With in my case "pathParam"=/x/y/z

When using the reactive rest client, everything is working well and my external API give me a 200.

As soon as i add the stork extension to retrieve the URL of the external API, i got a 404 error from my external API.
Stork is used only to retrieve "http://localhost:8081" as the base url.

If i understand well, when using reactive rest client without stork everything is ok because the called url is :
http://localhost:8081/api/v1/path/x%2Fy%2Fz (with "/" character correctly encoded)

When i do the same with stork, the url is well resolved (http://localhost:8081) but the url called is :
http://localhost:8081/api/v1/path/x/y/z (with "/" character not encoded as "%2F"

I will try to give a reproducer later if needed. Not easy to extract it actually because it's part of a big project.

Expected behavior

The expected behaviour would be to have the "/" (or others) well encoded when using stork extension.

Actual behavior

Actuel behavior is the "/" character as a PathParam is not well encoded only when using stork extension. It work's well when using the reactive rest client without Stork.

How to Reproduce?

To reproduce :

  • Call an external API that contains "/" character in path param. (http://localhost:port/api/v1/path/{pathParam} with pathParam=/x/y/z
  • With reactive rest client and without stork -> http response is 200
  • With reactive rest client + stork -> http response is 404

Output of uname -a or ver

Linux x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

openjdk version "11.0.9.1"

Quarkus version or git rev

3.6.0

Build tool (ie. output of mvnw --version or gradlew --version)

Maven 3.8.6

Additional information

No response

@Jojal Jojal added the kind/bug Something isn't working label Dec 13, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented Dec 13, 2023

/cc @aureamunoz (stork), @cescoffier (rest-client,stork), @geoand (rest-client)

aureamunoz added a commit to aureamunoz/quarkus that referenced this issue Dec 14, 2023
aureamunoz added a commit to aureamunoz/quarkus that referenced this issue Dec 19, 2023
aureamunoz added a commit to aureamunoz/quarkus that referenced this issue Dec 19, 2023
aureamunoz added a commit to aureamunoz/quarkus that referenced this issue Dec 19, 2023
aureamunoz added a commit to aureamunoz/quarkus that referenced this issue Jan 8, 2024
aureamunoz added a commit to aureamunoz/quarkus that referenced this issue Jan 9, 2024
…ng when creating new URI

Related to quarkusio#37713

refactor: clean up a few commented lines

fix: use raw path and avoid double encoding, adapt tests accordingly
@quarkus-bot quarkus-bot bot added this to the 3.7 - main milestone Jan 9, 2024
@gsmet gsmet modified the milestones: 3.7 - main, 3.6.5 Jan 9, 2024
gsmet pushed a commit to gsmet/quarkus that referenced this issue Jan 9, 2024
…ng when creating new URI

Related to quarkusio#37713

refactor: clean up a few commented lines

fix: use raw path and avoid double encoding, adapt tests accordingly
(cherry picked from commit ce206d5)
@aloubyansky aloubyansky modified the milestones: 3.6.5, 3.2.10.Final Jan 16, 2024
aloubyansky pushed a commit to aloubyansky/quarkus that referenced this issue Jan 16, 2024
…ng when creating new URI

Related to quarkusio#37713

refactor: clean up a few commented lines

fix: use raw path and avoid double encoding, adapt tests accordingly
(cherry picked from commit ce206d5)
aloubyansky pushed a commit to aloubyansky/quarkus that referenced this issue Jan 17, 2024
…ng when creating new URI

Related to quarkusio#37713

refactor: clean up a few commented lines

fix: use raw path and avoid double encoding, adapt tests accordingly
(cherry picked from commit ce206d5)
aureamunoz added a commit to aureamunoz/quarkus that referenced this issue Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants