feat(follow_redirect): Preserve extensions during redirection#581
feat(follow_redirect): Preserve extensions during redirection#5810x676e67 wants to merge 9 commits into
Conversation
|
Is this approach justifiable? |
Co-authored-by: Daiki Mizukami <tesaguriguma@gmail.com>
|
Four hours ago, tracing-core updated its version and upgraded msrv. CI seems to have failed because of this. |
|
Although I was not involved in #348, I guess it was a mere oversight that the design decision to drop extensions hadn't been revisited in the migration to That said, I think it's a breaking change so the commit message should clearly make that clear, as required in the |
|
Well, FWIW I didn't know this repo had a |
|
Eh, I don't know where all that came from, was it imported from Tokio? I don't personally care if people force push PRs. I know some people like to see the incremental changes after review passes, but I always have to review the entire change before I click merge, so I don't care. |
There was a problem hiding this comment.
@0x676e67 Sorry for the slow review...
I think that this was probably an oversight to omit, but there are security implications to turning it on. Extensions can leak sensitive information that previously was dropped. So certainly a breaking change.
We should also keep parity with the headers APIs and have FilterCredentials support for opt out via policy. It's a trickier problem than headers since mostly userspace types that we can't have a default excludelist for. I guess we could do some clever things if we have any types gated behind peer feature flags that we want to filter out.
Otherwise it seems like its mostly a user-provided filter. Probably something doable with macros to make it not-horrid to pass in a static list of type names/ids.
A simpler and non-breaking option would just be a opt-in API. (Long term I think it should be opt-out, but it can be a follow up)
Motivation
Extensions are passed during request redirection. Extensions that currently rely on
http 1.xare now cloneable.https://github.com/hyperium/http/blob/613d3d465f222666327d61f5971133cad155f190/src/extensions.rs#L35
Solution
Solve some scenarios where redirection requires passing
Extensions