1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-01-10 04:18:14 +02:00
oauth2-proxy/pkg/middleware
Mariano Vallés a999270cf3
Add req.host to targetURL when redirecting to https (#668)
* Add req.host to targetURL when redirecting to https

The req.URL.Host might not be present when redirecting to https if the
given req.URL is something like "/". In such scenario, the req.Host is
still present and valid.

This commit adds the original req.Host to the targetURL before returning
the 308 status, to avoid having a `Location: https:///` in the response.

* Bring back empty line

* Wrap the setting of targetURL.Host in a condition

* Add a comment to the test explaining why the redirectURL includes example.com

* Add changelog entry
2020-07-07 09:55:38 +01:00
..
healthcheck_test.go (#649) Remove blank helthcheck user agents and paths when setting up the healthcheck middleware 2020-07-06 14:07:38 +12:00
healthcheck.go (#649) Remove blank helthcheck user agents and paths when setting up the healthcheck middleware 2020-07-06 14:07:38 +12:00
middleware_suite_test.go Move RedirectToHTTPS to middleware package 2020-07-03 17:19:09 +01:00
redirect_to_https_test.go Add req.host to targetURL when redirecting to https (#668) 2020-07-07 09:55:38 +01:00
redirect_to_https.go Add req.host to targetURL when redirecting to https (#668) 2020-07-07 09:55:38 +01:00