You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think setRequestHeader sets it into the http.Header map and Host() works on request.Host which is not request.Header["Host"]
So it's not really <loopback> problem but a general one that we might want to fix
req.Header.Get(„Host“) is always empty string in a http handler or you added it yourself. We don’t copy request.Host to the req.Header.
The Host() predicate works on req.Host, setRequestHeader works only on req.Header. So the why is clear, but we might want to change the predicate to also check the Header or I think better would be to change the filter in case of Host we set req.Host.
Of course req.OutgoingHost needs to be considered depending if it’s set or not.
I think @aryszka can clarify how the details of the change should be.
This set of routes should return "It works!":
But it ends up in an infinite loop. This, however, works as expected:
where the only change is using the
Header("Host", "...")
predicate instead ofHost("...")
. Both approaches should work the same way.The text was updated successfully, but these errors were encountered: