From 365fa76db323509aabfeb037afec72772c5fa6a5 Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Thu, 12 May 2022 17:36:14 +1000 Subject: [PATCH 1/3] Issue #1771 - add module for secure redirect Signed-off-by: Lachlan Roberts --- .../main/config/etc/jetty-secure-redirect.xml | 22 +++++++++++++++++++ jetty-server/src/main/config/etc/jetty.xml | 2 +- .../main/config/modules/secure-redirect.mod | 17 ++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 jetty-server/src/main/config/etc/jetty-secure-redirect.xml create mode 100644 jetty-server/src/main/config/modules/secure-redirect.mod diff --git a/jetty-server/src/main/config/etc/jetty-secure-redirect.xml b/jetty-server/src/main/config/etc/jetty-secure-redirect.xml new file mode 100644 index 00000000000..3e2d14aca73 --- /dev/null +++ b/jetty-server/src/main/config/etc/jetty-secure-redirect.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/jetty-server/src/main/config/etc/jetty.xml b/jetty-server/src/main/config/etc/jetty.xml index b2d16df274c..423c63b0448 100644 --- a/jetty-server/src/main/config/etc/jetty.xml +++ b/jetty-server/src/main/config/etc/jetty.xml @@ -60,7 +60,7 @@ - + diff --git a/jetty-server/src/main/config/modules/secure-redirect.mod b/jetty-server/src/main/config/modules/secure-redirect.mod new file mode 100644 index 00000000000..6a300b86250 --- /dev/null +++ b/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. + +[tags] +handler + +[depend] +server + +[xml] +etc/jetty-secure-redirect.xml + +[ini-template] +## The redirect code to use in the response. +# jetty.redirect.code=302 From 32ed6fab9c4638840d092e275df9a5ae10726665 Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Tue, 17 May 2022 16:44:03 +1000 Subject: [PATCH 2/3] Issue #1771 - changes from review Signed-off-by: Lachlan Roberts --- .../main/config/etc/jetty-secure-redirect.xml | 16 +++------------- jetty-server/src/main/config/etc/jetty.xml | 2 +- .../src/main/config/modules/secure-redirect.mod | 2 +- 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/jetty-server/src/main/config/etc/jetty-secure-redirect.xml b/jetty-server/src/main/config/etc/jetty-secure-redirect.xml index 3e2d14aca73..b834c2f0c85 100644 --- a/jetty-server/src/main/config/etc/jetty-secure-redirect.xml +++ b/jetty-server/src/main/config/etc/jetty-secure-redirect.xml @@ -2,20 +2,10 @@ - - + - - - - - - - - - - - + + diff --git a/jetty-server/src/main/config/etc/jetty.xml b/jetty-server/src/main/config/etc/jetty.xml index 423c63b0448..b2d16df274c 100644 --- a/jetty-server/src/main/config/etc/jetty.xml +++ b/jetty-server/src/main/config/etc/jetty.xml @@ -60,7 +60,7 @@ - + diff --git a/jetty-server/src/main/config/modules/secure-redirect.mod b/jetty-server/src/main/config/modules/secure-redirect.mod index 6a300b86250..fd845099fe8 100644 --- a/jetty-server/src/main/config/modules/secure-redirect.mod +++ b/jetty-server/src/main/config/modules/secure-redirect.mod @@ -14,4 +14,4 @@ etc/jetty-secure-redirect.xml [ini-template] ## The redirect code to use in the response. -# jetty.redirect.code=302 +# jetty.secureredirect.code=302 From ed122dfa3c64c9a7b56950b342d938b8c056b1b1 Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Wed, 25 May 2022 15:22:08 +1000 Subject: [PATCH 3/3] update description in secure-redirect.mod Signed-off-by: Lachlan Roberts --- jetty-server/src/main/config/modules/secure-redirect.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jetty-server/src/main/config/modules/secure-redirect.mod b/jetty-server/src/main/config/modules/secure-redirect.mod index fd845099fe8..a0b54bc6e78 100644 --- a/jetty-server/src/main/config/modules/secure-redirect.mod +++ b/jetty-server/src/main/config/modules/secure-redirect.mod @@ -1,7 +1,7 @@ DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html [description] -Enable SecuredRedirectHandler to redirect all http requests to https. +Enable SecuredRedirectHandler to redirect all http requests to https on the secure port configured in the server.ini file. [tags] handler