-
Notifications
You must be signed in to change notification settings - Fork 18k
net/http: optionally add headers on redirect #24004
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This PR (HEAD: f369c10) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/#/c/go/+/95895 to see it. Tip: You can toggle comments from me using the |
Message from Brad Fitzpatrick: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/95895. |
Message from Zachary Gershman: Patch Set 1:
Is that clear enough? I actively struggled with the name so I welcome the feedback here. Originally I had the field as ForwardHeader(s) but that didn't feel right either. Please don’t reply on this GitHub thread. Visit golang.org/cl/95895. |
Message from Brad Fitzpatrick: Patch Set 1:
Well, FooPolicy returning a bool is weird. A policy often has more than two values, and they're often not called true & false. So naming it something that has a yes/no answer (Allow, Reject, Forward, Redirect) makes more sense, because they it reads well at call sites too. But yeah, I think RedirectHeader is fine (especially since it'll still have docs). Or ShouldRedirectHeader, but there's no precedence for the name "Should" in existing Go API anywhere. Please don’t reply on this GitHub thread. Visit golang.org/cl/95895. |
Message from Kunpei Sakai: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/95895. |
a8a60ac
to
87412a1
Compare
e4259d6
to
6dbaf03
Compare
07b8191
to
a371bc2
Compare
9092511
to
95c3348
Compare
Message from Gerrit User 5065: Patch Set 1: Ping Zach. Please don’t reply on this GitHub thread. Visit golang.org/cl/95895. |
Message from Gerrit User 24545: Patch Set 1: Definitely going to finish this - sorry I’ve let it sit for so long, haven’t seen a burning need from anyone in the community for the feature (not really an excuse). Will wrap this last week of October when I am back from vacation. Thanks for the patience. Please don’t reply on this GitHub thread. Visit golang.org/cl/95895. |
Message from Agniva De Sarker: Patch Set 1: Zach, just checking in to see if you got a chance to look at this ? Please don’t reply on this GitHub thread. Visit golang.org/cl/95895. |
Message from Zachary Gershman: Patch Set 1:
So sorry, I had not. I really apologize for putting this down so long. Going to get something done today. Please don’t reply on this GitHub thread. Visit golang.org/cl/95895. |
This PR (HEAD: eefe499) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/95895 to see it. Tip: You can toggle comments from me using the |
Message from Agniva De Sarker: Patch Set 2:
No worries. Please mark comments as "Done" once you have addressed them. Please don’t reply on this GitHub thread. Visit golang.org/cl/95895. |
Message from Zach Gershman: Patch Set 2: (2 comments)
All feedback resolved in patch set 2 Please don’t reply on this GitHub thread. Visit golang.org/cl/95895. |
Message from Zach Gershman: Patch Set 2: Hey everyone - I realize the irony that I am not poking this fix after letting it languish for so long. Can someone take a quick review and run Trybot? Cheers! Please don’t reply on this GitHub thread. Visit golang.org/cl/95895. |
Message from Brad Fitzpatrick: Patch Set 3: Patch Set 2 was rebased Please don’t reply on this GitHub thread. Visit golang.org/cl/95895. |
Message from Brad Fitzpatrick: Patch Set 3: Run-TryBot+1 The docs say nothing about the handful of magic headers that avoid the user-provided policy function. Please don’t reply on this GitHub thread. Visit golang.org/cl/95895. |
Message from Gobot Gobot: Patch Set 3: TryBots beginning. Status page: https://farmer.golang.org/try?commit=2c209a39 Please don’t reply on this GitHub thread. Visit golang.org/cl/95895. |
Message from Gobot Gobot: Patch Set 3: Build is still in progress... Other builds still in progress; subsequent failure notices suppressed until final report. Consult https://build.golang.org/ to see whether they are new failures. Keep in mind that TryBots currently test exactly your git commit, without rebasing. If your commit's git parent is old, the failure might've already been fixed. Please don’t reply on this GitHub thread. Visit golang.org/cl/95895. |
Message from Zach Gershman: Patch Set 3:
Agreed - will straighten that out in the comment. Appreciate the feedback Brad. Please don’t reply on this GitHub thread. Visit golang.org/cl/95895. |
This PR (HEAD: dedd217) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/95895 to see it. Tip: You can toggle comments from me using the |
Message from Agniva De Sarker: Patch Set 4: Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/95895. |
Message from Gobot Gobot: Patch Set 4: TryBots beginning. Status page: https://farmer.golang.org/try?commit=e3e7b054 Please don’t reply on this GitHub thread. Visit golang.org/cl/95895. |
Message from Gobot Gobot: Patch Set 4: Build is still in progress... Other builds still in progress; subsequent failure notices suppressed until final report. Consult https://build.golang.org/ to see whether they are new failures. Keep in mind that TryBots currently test exactly your git commit, without rebasing. If your commit's git parent is old, the failure might've already been fixed. Please don’t reply on this GitHub thread. Visit golang.org/cl/95895. |
Message from Agniva De Sarker: Patch Set 4: failures look real Please don’t reply on this GitHub thread. Visit golang.org/cl/95895. |
Message from Zach Gershman: Patch Set 4:
That's interesting - are these lookup failures actually legit? Why didn't the other 10 builds fail? Please don’t reply on this GitHub thread. Visit golang.org/cl/95895. |
I've actually decided to close this. I feel like adding this additional knob doesn't seem like it will impact that many people and the current default behavior is probably fine as is. |
Fixes #19973