Skip to content

Commit

Permalink
Merge pull request #7983 from eclipse/jetty-10.0.x-1771-secureRedirec…
Browse files Browse the repository at this point in the history
…tHandler

Issue #1771 - add module for secure redirect
  • Loading branch information
lachlan-roberts committed May 30, 2022
2 parents 3fe0d5e + ed122df commit 94e40a9
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
12 changes: 12 additions & 0 deletions jetty-server/src/main/config/etc/jetty-secure-redirect.xml
@@ -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>
17 changes: 17 additions & 0 deletions jetty-server/src/main/config/modules/secure-redirect.mod
@@ -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

0 comments on commit 94e40a9

Please sign in to comment.