Merge pull request #7983 from eclipse/jetty-10.0.x-1771-secureRedirectHandler

Issue #1771 - add module for secure redirect
This commit is contained in:
Lachlan 2022-05-30 11:58:52 +10:00 committed by GitHub
commit 94e40a93cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,12 @@
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd">
<Configure id="Server" class="org.eclipse.jetty.server.Server">
<Call name="insertHandler">
<Arg>
<New id="SecuredRedirectHandler" class="org.eclipse.jetty.server.handler.SecuredRedirectHandler">
<Arg type="int"><Property name="jetty.secureredirect.code" default="302"/></Arg>
</New>
</Arg>
</Call>
</Configure>

View File

@ -0,0 +1,17 @@
DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html
[description]
Enable SecuredRedirectHandler to redirect all http requests to https on the secure port configured in the server.ini file.
[tags]
handler
[depend]
server
[xml]
etc/jetty-secure-redirect.xml
[ini-template]
## The redirect code to use in the response.
# jetty.secureredirect.code=302