Skip to content

Fix redirect loop with PROXYv2

Igor requested to merge proxyv2-fix-redirect into master

I ran into an issue while rolling out PROXYv2 on gstg. It was creating a redirect loop, by attempting to redirect to the HTTPS version of the page.

The proxyHandler uses gorilla/handlers.ProxyHeaders and skips httpInitialMiddleware. That means we are skipping setRequestScheme -- and thus unable to know that the request is in fact an HTTPS one.

I was able to experimentally verify that the fix works. I was unable to reproduce this in the test suite unfortunately.

I would like to tag a hotfix release with this fix if possible, in order to unblock the rollout ass quickly as possible.

refs https://gitlab.com/gitlab-com/gl-infra/infrastructure/-/issues/11902

Edited by Igor

Merge request reports