-
Notifications
You must be signed in to change notification settings - Fork 105
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
Add option for set cache policy based on cookie name or pattern #1564
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but this has nothing avout #1544 . Please fix the PR message before merging to not to close the issue by the merge.
P.S. Oh, I didn't notice that this is a Draft. Sorry.
6f30c7d
to
fbe2eb8
Compare
Fixes #1544 Signed-off-by: Aleksey Mikhaylov <[email protected]>
fbe2eb8
to
f68cf86
Compare
chore: fix followed PR comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to merge after minor fixes and several cleanups
chore: fix followed PR comments
Updated PR. Please look at not resolved comments. |
chore: fix followed PR comments
chore: fix followed PR comments
Fixes #1544
PR adds new rule to http chains. Field 'cookie', field value string with prefix or postfix wildcard, forced (for now) equality sign, field argument string with prefix or postfix wildcard, action that typically should set new flag '$cache'.
The PR contains feature implementation and unit tests for http chains cookie rule. No functional tests.
Please note, that cookie field value string in
TfwHttpMatchRule
for cookie name matching is allocated string.Implemented logic works only for requests. Header
Set-Cookie
not consulted.In fact only setting
$cache
variable to zero works as expected. Setting it to 1 is just leaving Tempesta FW caching logic intact.Currently in implemented logic setting
$cache
to 1 after some previous cookie rules set it to 0 will effectivelly reset it, as if it never set to zero.As side-effect
$cache
setting action is usable in other rules as well.Cookie name and value matching are case-sensitive. As i can see RFC6265#section-4.2 has no mention of case-insensitive matching (as it does for cookie attributes).
Signed-off-by: Aleksey Mikhaylov [email protected]