MINOR: http: don't close when redirect location doesn't start with "/"
authorWilly Tarreau <w@1wt.eu>
Tue, 28 Feb 2017 08:48:11 +0000 (09:48 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 28 Feb 2017 08:48:11 +0000 (09:48 +0100)
commit19b1412e021451d4c7ac39750b556efaaf8639bf
tree0ac2daf25b8802832f1f806e0231bb499a00ff72
parent4f86264bae1e8bec4bf0f0596975597f6fec48ef
MINOR: http: don't close when redirect location doesn't start with "/"

In 1.4-dev5 when we started to implement keep-alive, commit a9679ac
("[MINOR] http: make the conditional redirect support keep-alive")
added a specific check was added to support keep-alive on redirect
rules but only when the location would start with a "/" indicating
the client would come back to the same server.

But nowadays most applications put http:// or https:// in front of
each and every location, and continuing to perform a close there is
counter-efficient, especially when multiple objects are fetched at
once from a same origin which redirects them to the correct origin
(eg: after an http to https forced upgrade).

It's about time to get rid of this old trick as it causes more harm
than good at an era where persistent connections are omnipresent.

Special thanks to Ciprian Dorin Craciun for providing convincing
arguments with a pretty valid use case and proposing this draft
patch which addresses the issue he was facing.

This change although not exactly a bug fix should be backported
to 1.7 to adapt better to existing infrastructure.
src/proto_http.c