-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Added CookieMatches for Cookie matching on requests #141
base: master
Are you sure you want to change the base?
Conversation
Hi, Thanks for the PR. I'm not sure if matching against the cookie representation is a good idea. I'd add a way to match |
Hi ! In my case, I was trying to find a regexp matching cookie being sent in the request and then modifying/deleting/triggering whatever behaviour we wanted. That is why I decided to add the same functionality as:
We can add also something more strict as you propose. Something like "CookieIs" as in the host-related function, but based on the cookie key and/or value:
|
Didn't you know in advance which key would the cookie contain? On Tue, Jan 19, 2016 at 10:29 AM, Borja Berastegui <[email protected]
|
In my specific case yes, one key in particular. But in the case that the key might be variable (I've seen several applications doing this), it will be great to be able to match it using a regexp. |
In this case we should give two regexp, for the key and for the value. This would avoid all the key escaping problems. On Tue, Jan 19, 2016 at 10:42 AM, Borja Berastegui <[email protected]
|
So, two separate functions like:
And:
Or one function with two parameters:
Or:
? |
With CookieMatches you will be able to trigger any behaviour if you find regexp matches against some particular cookie pattern.