From acded5f1bedad16f49906057d9ca8fb95e00a842 Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Mon, 6 Jan 2025 09:57:46 -0800 Subject: [PATCH] proxies / redirects: add trailing / to prevent unintended redirects Without this you can get the redirect to redirect to another host. Not a super big problem, but definitely not intended. Hopefully just adding a tailing / will not break anything. Signed-off-by: Kevin Fenzi --- roles/httpd/redirect/templates/redirect.conf | 2 +- roles/httpd/redirectmatch/templates/redirectmatch.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/httpd/redirect/templates/redirect.conf b/roles/httpd/redirect/templates/redirect.conf index 91c50d8e8c..9d3e587a56 100644 --- a/roles/httpd/redirect/templates/redirect.conf +++ b/roles/httpd/redirect/templates/redirect.conf @@ -1 +1 @@ -Redirect 302 {{ path }} {{ target }} +Redirect 302 {{ path }} {{ target }}/ diff --git a/roles/httpd/redirectmatch/templates/redirectmatch.conf b/roles/httpd/redirectmatch/templates/redirectmatch.conf index 9becff73dd..d39e34a0d0 100644 --- a/roles/httpd/redirectmatch/templates/redirectmatch.conf +++ b/roles/httpd/redirectmatch/templates/redirectmatch.conf @@ -1,3 +1,3 @@ {% if redirectmatch_enabled %} -RedirectMatch {{ status }} {{ regex }} {{ target }} +RedirectMatch {{ status }} {{ regex }} {{ target }}/ {% endif %}