mirror of
https://github.com/linuxserver/fleet.git
synced 2026-02-20 05:11:08 +08:00
Ensure redirect not sent twice when verifying admin route on initial registration
This commit is contained in:
parent
6ce1e99438
commit
26322ade92
@ -100,6 +100,9 @@ public class WebServer {
|
||||
|
||||
return () -> before(path, (request, response) -> {
|
||||
|
||||
if (response.raw().isCommitted())
|
||||
return;
|
||||
|
||||
Session session = request.session(false);
|
||||
|
||||
if (null == session)
|
||||
|
||||
@ -23,6 +23,8 @@ import spark.Filter;
|
||||
import spark.Request;
|
||||
import spark.Response;
|
||||
|
||||
import static spark.Spark.halt;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Forces the maintainer of Fleet to set up an initial user before running Fleet.
|
||||
@ -51,7 +53,7 @@ public class InitialUserFilterRoute implements Filter {
|
||||
if (databaseAuthenticationEnabled) {
|
||||
|
||||
if (!initialUserNeedsConfiguring() && "/admin/setup".equals(request.pathInfo())) {
|
||||
response.redirect("/admin");
|
||||
halt(401);
|
||||
}
|
||||
|
||||
else if (initialUserNeedsConfiguring() && !pathIsExempted(request.pathInfo())) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user