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

Change redirection from /q/dev to /q/dev-ui to be FOUND instead of MOVED_PERMANENTLY #33910

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -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;
Expand Down Expand Up @@ -98,8 +99,14 @@ public Handler<RoutingContext> redirect(String contextRoot) {
return new Handler<RoutingContext>() {
@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();
}
};
}
Expand Down