diff options
| author | Omar Roth <omarroth@hotmail.com> | 2018-03-09 13:35:31 -0600 |
|---|---|---|
| committer | Omar Roth <omarroth@hotmail.com> | 2018-03-09 13:35:31 -0600 |
| commit | 84fc87229c19e55d4968f3d936634668bd4fcbd8 (patch) | |
| tree | fb9fed95308797f7cded0b999494885898b6ff8e /src | |
| parent | 2596410b97d1328d942229e9742c60448c32d5eb (diff) | |
| download | invidious-84fc87229c19e55d4968f3d936634668bd4fcbd8.tar.gz invidious-84fc87229c19e55d4968f3d936634668bd4fcbd8.tar.bz2 invidious-84fc87229c19e55d4968f3d936634668bd4fcbd8.zip | |
Add full path redirect
Diffstat (limited to 'src')
| -rw-r--r-- | src/invidious.cr | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/invidious.cr b/src/invidious.cr index 9e4c3408..efa2a96c 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -343,7 +343,8 @@ if Kemal.config.ssl && redirect spawn do server = HTTP::Server.new("0.0.0.0", 80) do |context| context.response.headers.add "Strict-Transport-Security", "max-age=31536000; includeSubDomains; preload" - context.response.headers.add "Location", "https://#{context.request.headers["Host"]}" + redirect_url = "https://#{context.request.host}#{context.request.path}?#{context.request.query}" + context.response.headers.add "Location", redirect_url context.response.status_code = 302 end |
