From 4031d6259a25036bdd30536c9806e92486abe8db Mon Sep 17 00:00:00 2001 From: Clement Escoffier Date: Thu, 8 Jun 2023 15:14:18 +0200 Subject: [PATCH] Change redirection from /q/dev to /q/dev-ui --- .../java/io/quarkus/devui/runtime/DevUIRecorder.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/extensions/vertx-http/runtime/src/main/java/io/quarkus/devui/runtime/DevUIRecorder.java b/extensions/vertx-http/runtime/src/main/java/io/quarkus/devui/runtime/DevUIRecorder.java index 4b8eca0d50688..57fc606b1b702 100644 --- a/extensions/vertx-http/runtime/src/main/java/io/quarkus/devui/runtime/DevUIRecorder.java +++ b/extensions/vertx-http/runtime/src/main/java/io/quarkus/devui/runtime/DevUIRecorder.java @@ -17,6 +17,7 @@ import org.jboss.logging.Logger; +import io.netty.handler.codec.http.HttpResponseStatus; import io.quarkus.arc.runtime.BeanContainer; import io.quarkus.dev.console.DevConsoleManager; import io.quarkus.devui.runtime.comms.JsonRpcRouter; @@ -98,8 +99,14 @@ public Handler redirect(String contextRoot) { return new Handler() { @Override public void handle(RoutingContext rc) { - // 308 because we also want to redirect other HTTP Methods (and not only GET). - rc.response().putHeader("Location", contextRoot + "dev-ui").setStatusCode(308).end(); + // Initially we were using 308 (MOVED PERMANENTLY) because we also want to redirect other HTTP Methods + // (and not only GET). + // However, it caused issues with browser caches and prevented users to have applications using Quarkus 2 + // and Quarkus 3 at the same time. So, we decided to switch to FOUND (302) + // See https://github.com/quarkusio/quarkus/issues/33658 for more context. + rc.response() + .putHeader("Location", contextRoot + "dev-ui") + .setStatusCode(HttpResponseStatus.FOUND.code()).end(); } }; }