-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Add CORS route to DevConsole #29342
Add CORS route to DevConsole #29342
Conversation
Thanks for your pull request! The title of your pull request does not follow our editorial rules. Could you have a look?
|
Hi @gsmet Not sure about the bot message, it starts with |
This comment has been minimized.
This comment has been minimized.
...x-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/devmode/DevConsoleCORSFilter.java
Outdated
Show resolved
Hide resolved
...x-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/devmode/DevConsoleCORSFilter.java
Outdated
Show resolved
Hide resolved
...x-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/devmode/DevConsoleCORSFilter.java
Outdated
Show resolved
Hide resolved
...x-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/devmode/DevConsoleCORSFilter.java
Outdated
Show resolved
Hide resolved
@michalvavrik Hi Michal, looks like |
I'll check today and get back to you. |
I run your PR on Windows Server 2022 and could not reproduce it, I'll try investigate how could it theoretically happen, but please, if you ever see this failure again in another PR/CI, please let me know, thank you. |
Ah, I can explain it (with little guessing), will provide PR later today. |
7821d4f
to
ebc646c
Compare
@stuartwdouglas I've added a dedicated |
This comment has been minimized.
This comment has been minimized.
...x-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/devmode/DevConsoleCORSFilter.java
Show resolved
Hide resolved
...x-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/devmode/DevConsoleCORSFilter.java
Show resolved
Hide resolved
extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/cors/CORSConfig.java
Show resolved
Hide resolved
...x-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/devmode/DevConsoleCORSFilter.java
Show resolved
Hide resolved
...x-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/devmode/DevConsoleCORSFilter.java
Show resolved
Hide resolved
@sberyozkin @stuartwdouglas @cescoffier: be aware that Chrome behavior for localhost may not be what you expect: |
Hi @pmlopes
Yeah, thanks, we touched upon some of the issues like that one; here though the DevConsole filter requires concrete Origin values, wildcard will not be returned |
ab9c920
to
7169469
Compare
...x-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/devmode/DevConsoleCORSFilter.java
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this PR needs some changes.
HTTPS topic was covered in my previous comments, config update using DevUI on https is not working.
There are other issues I found:
127.0.0.1 use-case
Changing value using http://127.0.0.1:8080/api/q/dev/io.quarkus.quarkus-vertx-http/config triggers 2022-11-23 08:58:39,800 ERROR [io.qua.ver.htt.run.dev.DevConsoleCORSFilter] (vert.x-eventloop-thread-1) Only localhost origin is allowed, but Origin header value is: http://127.0.0.1:8080
hostname use-case
Changing value using http://rsvoboda-mac:8080/api/q/dev/io.quarkus.quarkus-vertx-http/config triggers 2022-11-23 09:45:31,871 ERROR [io.qua.ver.htt.run.dev.DevConsoleCORSFilter] (vert.x-eventloop-thread-0) Only localhost origin is allowed, but Origin header value is: http://rsvoboda-mac:8080
traceroute rsvoboda-mac
traceroute to localhost (127.0.0.1), 64 hops max, 52 byte packets
1 localhost (127.0.0.1) 0.611 ms 0.050 ms 0.040 ms
I think at least 127.0.0.1 use-case should be covered.
Hostname use-case could be handled later
7169469
to
537e81b
Compare
Sure, fixed it.
I agree, I'm not sure a DNS related check will have no side-effects on the overall DevUI experience. Local DevUI is meant to be used locally, and typing a fully qualified host name during the local work seems unnecessary. But we have a new DevUI specific CORS group - so we can add a property there, |
@sberyozkin agree with the plan. I will try some experiments with this PR and provide feedback tmr morning |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No further concerns with this PR
Checked items:
-
http vs. https
-
localhost use-case vs. 127.0.0.1 use-case vs. hostname use-case
-
/q/dev vs. customized /api/q/dev
-
OS: macOS, Windows
-
Browsers: Firefox, Vivaldi, Brave, Chrome, Edge, Safari
This is a proper testing :-), thanks |
And no Netscape? |
I'm missing Opera :) |
No worries, I tried Opera too, just didn't list it :) Netscape ... hm, I would need to time travel back to Windows 98 times |
Note to |
addresses: quarkusio#29342 (comment) (cherry picked from commit 2daf961)
No description provided.