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

RestClient does not suppport _ in url #30463

Closed
Kizoku-Dev opened this issue Jan 19, 2023 · 7 comments
Closed

RestClient does not suppport _ in url #30463

Kizoku-Dev opened this issue Jan 19, 2023 · 7 comments
Labels
area/rest-client kind/bug Something isn't working triage/wontfix This will not be worked on

Comments

@Kizoku-Dev
Copy link

Describe the bug

I configured the base url through the application.yml. My url is working as I can request it through postman for exemple.
The URL is : http://test.some_url.domain.com
As you can see there is an _ in the URL. If I run the app with this when I try to make a call through the rest client, it try to connect to locahost instead of my URL.
But when I try an URL without _ or when I call my rest service through the IP instead of the URL it works.

Expected behavior

Rest client connect to my URL in order to process my call.

Actual behavior

Rest client try to connect to localhost.
trace

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.15.3

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

No response

Additional information

When I use the URL with an _ I can see that my rest client is build with the URL in its authority field.
authority

When I use the URL without an _ or with an IP I can see that my rest client is build with the URL in its host field.
host

@Kizoku-Dev Kizoku-Dev added the kind/bug Something isn't working label Jan 19, 2023
@geoand
Copy link
Contributor

geoand commented Jan 19, 2023

Very interesting...

We'll take a look soon

@quarkus-bot
Copy link

quarkus-bot bot commented Jan 19, 2023

/cc @Sgitario (rest-client), @cescoffier (rest-client)

@gsmet
Copy link
Member

gsmet commented Jan 19, 2023

Hmmm, is _ actually valid in domain names?

@geoand
Copy link
Contributor

geoand commented Jan 19, 2023

I'm looking into that now

@geoand
Copy link
Contributor

geoand commented Jan 19, 2023

It appears that host names are limited to letters-digits-hyphen according to RFC 1123, section 2.1 "Host Names and Numbers".

@geoand geoand closed this as not planned Won't fix, can't repro, duplicate, stale Jan 19, 2023
@geoand geoand added triage/invalid This doesn't seem right triage/wontfix This will not be worked on and removed triage/invalid This doesn't seem right labels Jan 19, 2023
@gsmet gsmet reopened this Jan 19, 2023
@gsmet
Copy link
Member

gsmet commented Jan 19, 2023

I'm not saying we should fix this but the error we throw is a bit weird to me.

@Kizoku-Dev if you provide a small reproducer, I will have a look at trying to improve the user feedback.

gsmet added a commit to gsmet/quarkus that referenced this issue Jan 19, 2023
@gsmet
Copy link
Member

gsmet commented Jan 20, 2023

My guess is that you should have a better error message with the following PR: #30490 .

I'm closing this. If you can come up with a small reproducer, please attach it so I can make sure the error message is now actionable.

@gsmet gsmet closed this as not planned Won't fix, can't repro, duplicate, stale Jan 20, 2023
ebullient pushed a commit to maxandersen/quarkus that referenced this issue Jan 24, 2023
mfpc pushed a commit to mfpc/quarkus that referenced this issue Jan 26, 2023
gsmet added a commit to gsmet/quarkus that referenced this issue Jan 27, 2023
As experienced in quarkusio#30463, it seems it can happen.

(cherry picked from commit cec7cd3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/rest-client kind/bug Something isn't working triage/wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants