Relaxed Vary header defaults#674
Conversation
Signed-off-by: Aminu Oluwaseun Joshua <seun.aminujoshua@gmail.com>
Signed-off-by: Aminu Oluwaseun Joshua <seun.aminujoshua@gmail.com>
|
This is worse than the current state of things IMO. Has the current default caused some specific issue for you? |
|
++ to @jplatte 's feedback that this will break a lot of users since we are shifting from "conservative" defaults (include Would it work to instead have Or are there other overly conservative cases you are concerned with @seun-ja ? |
|
So, what I was thinking of when writing the referenced comment was having the various methods like |
Signed-off-by: Aminu Oluwaseun Joshua <seun.aminujoshua@gmail.com>
Signed-off-by: Aminu Oluwaseun Joshua <seun.aminujoshua@gmail.com>
jlizen
left a comment
There was a problem hiding this comment.
The approach of eagerly stripping the vary headers based on permissive() creates a problem:
CorsLayer::permissive().allow_origin(AllowOrigin::predicate(...))
This would produce no vary: origin header, when in fact we might have dynamic CORS that has multiple allowed origins. That could result in a stale cache improperly rejecting origins that DO match the predicate.
The proper way to handle this would be, like jplatte@ suggested, doing the stripping on the explicit allow_* methods.
And then, we also would need an extra Is_custom_vary parameter in the builder (or something), to make sure that we don't overwrite the user's explicit configuration.
Motivation
Fixes #539
Relaxes the default Vary header to an empty list.
Solution
Instead of the custom
Defaultimplementation adding some header values, it now simply returns the out-of-the-boxDefault, which is an empty Vector.Also, I altered the test to reflect the new change and an additional test.