Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #1771 - add module for secure redirect
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
- Loading branch information
1 parent
b47d9c4
commit b91182f
Showing
3 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
jetty-server/src/main/config/etc/jetty-secure-redirect.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?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"> | ||
<Get id="Handler" name="handler"/> | ||
<Call name="setHandler"> | ||
<Arg> | ||
<New class="org.eclipse.jetty.server.handler.HandlerList"> | ||
<Call name="addHandler"> | ||
<Arg> | ||
<New id="SecuredRedirectHandler" class="org.eclipse.jetty.server.handler.SecuredRedirectHandler"> | ||
<Arg type="int"><Property name="jetty.redirect.code" default="302"/></Arg> | ||
</New> | ||
</Arg> | ||
</Call> | ||
<Call name="addHandler"> | ||
<Arg><Ref refid="Handler"/></Arg> | ||
</Call> | ||
</New> | ||
</Arg> | ||
</Call> | ||
</Configure> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. | ||
|
||
[tags] | ||
handler | ||
|
||
[depend] | ||
server | ||
|
||
[xml] | ||
etc/jetty-secure-redirect.xml | ||
|
||
[ini-template] | ||
## The redirect code to use in the response. | ||
# jetty.redirect.code=302 |