Skip to content

Commit

Permalink
Merge pull request #33910 from cescoffier/switch-permanent-redirect-t…
Browse files Browse the repository at this point in the history
…o-found

Change redirection from /q/dev to /q/dev-ui to be FOUND instead of MOVED_PERMANENTLY
  • Loading branch information
cescoffier committed Jun 9, 2023
2 parents 44cea45 + 4031d62 commit 853fc9c
Showing 1 changed file with 9 additions and 2 deletions.
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

0 comments on commit 853fc9c

Please sign in to comment.