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

event.request().absoluteURI() returns an HTTP URL for a HTTPS request in Dev UI #29612

Closed
gsmet opened this issue Dec 1, 2022 · 3 comments
Closed
Assignees
Labels
area/vertx kind/bug Something isn't working triage/wontfix This will not be worked on

Comments

@gsmet
Copy link
Member

gsmet commented Dec 1, 2022

I don't know if it's a problem specific to Dev UI or not but it was reproduced in the Dev UI using:

https://github.com/rsvoboda/code-with-quarkus/ at commit e8e79723136a9062e013a4c3d705e3c12cd301d2

Reproducing the issue is easy:

  • Start with mvn quarkus:dev
  • Go to https://localhost:8443/dev/ui (and discard the warning about the certificate)
  • Go to the config editor
  • Change a value of the top property (a datasource one) and validate the change
  • You won't get any success message and if you open the network console, you will see that the POST actually tried to redirect to a HTTP URL (see Location header of the 303 response), which leads to a CORS error (it's easier to see that in the Firefox dev console, I had trouble having the information with a Chromium-based browser)

The problem is that we end up with event.request().absoluteURI() returning an HTTP URL here: https://github.com/quarkusio/quarkus/blob/2.14/extensions/vertx-http/dev-console-runtime-spi/src/main/java/io/quarkus/devconsole/runtime/spi/DevConsolePostHandler.java#L78 so Quarkus tries to redirect to an HTTP URL and it's intercepted by the CORS checks.

@gsmet
Copy link
Member Author

gsmet commented Dec 1, 2022

@cescoffier assigning this to you at least for finding out what's going on.

@cescoffier
Copy link
Member

So... it's a virtual channel "issue" or "feature".

The virtual server/channel used by the dev console does not have the SSLHandler, because it's a virtual thing. Unfortunately, the scheme() method checks if we have the SSLHandler in the netty pipeline, which we don't in this case.

I need to think if we need to fix it or not (and how).

@cescoffier
Copy link
Member

Let's keep it like this for now. If it because a prominent issue we can revisit it, but adding the SSL Handler to the virtual channel is tricky as it needs to be the same handler as the main one.

@cescoffier cescoffier added the triage/wontfix This will not be worked on label Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/vertx kind/bug Something isn't working triage/wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants