diff options
author | Florian Zschocke <f.zschocke+git@gmail.com> | 2022-11-11 18:53:57 +0100 |
---|---|---|
committer | Florian Zschocke <f.zschocke+git@gmail.com> | 2022-11-11 18:53:57 +0100 |
commit | 609130e26c51739dc9a6d278b2006929546271e1 (patch) | |
tree | ea7f8827844b9834ce789eb870c983403afdd30a /src/main | |
parent | e8a7b2d9f4a7ead8a195158ac8dc233735e00858 (diff) | |
download | gitblit-609130e26c51739dc9a6d278b2006929546271e1.tar.gz gitblit-609130e26c51739dc9a6d278b2006929546271e1.zip |
fix: Fix jetty crashing when redirecting HTTP to HTTPS
Jetty 9.3 changed the `setHandler` on the ServletContextHandler to no
longer automatically detect SecurityHandler, SessionHandler, etc. It
simply passes on the setHandler request to the ContextHandler class
(with a warning logged). So make sure to explicitly use the method
`setSecurityHandler` to set the ContraintSecurityHandler responsible
for the http -> https redirection.
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/com/gitblit/GitBlitServer.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/com/gitblit/GitBlitServer.java b/src/main/java/com/gitblit/GitBlitServer.java index 63914121..ae01e8e0 100644 --- a/src/main/java/com/gitblit/GitBlitServer.java +++ b/src/main/java/com/gitblit/GitBlitServer.java @@ -453,7 +453,7 @@ public class GitBlitServer { sh.setConstraintMappings(new ConstraintMapping[] { cm }); // Configure this context to use the Security Handler defined before - rootContext.setHandler(sh); + rootContext.setSecurityHandler(sh); } // Setup the Gitblit context |