You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current query cookie return the cookie value (and ignores the other attributes such as path, domain, ...)
cookie "theme" equals "light"
It would be interesting to fully support cookies as defined in the http spec.
the query cookie could return a Cookie Object instead of a simple string.
This object would include a mandatory string value, an optional domain, an option value, ...
The predicate equals (and matches?) could then be applied on this query taking a String value.
There are several options for the semantic of this String value.
For example
cookie "sessionToken" equals "abc123; Expires=Wed, 09 Jun 2021 10:18:14 GMT"
the path and domain must not be defined in the response cookie
cookie "LSID" equals "DQAAAK…Eaem_vYg; Path=/accounts; Expires=Wed, 13 Jan 2021 22:23:01 GMT; Secure; HttpOnly"
the order of attributes does not matter
cookie "LSID" matches "DQAAAK…Eaem_vYg; Path=/accounts; Expires=.*; Secure; HttpOnly"
when you need to use a regex you explicitly use the matched predicate
instead it could be easier to omit the attribute to ignore the attribute.
cookie "LSID" equals "DQAAAK…Eaem_vYg; Path=/accounts; Secure; HttpOnly"
you don't check the Expires attribute at all. It does not matter whether it is present on not.
But then, how do you check whether a cookie is a session cookie?
Another option: ´cookie´ could be extended as a query expression like jsonpath/xpath:
The current query cookie return the cookie value (and ignores the other attributes such as path, domain, ...)
cookie "theme" equals "light"
It would be interesting to fully support cookies as defined in the http spec.
the query cookie could return a Cookie Object instead of a simple string.
This object would include a mandatory string value, an optional domain, an option value, ...
The predicate equals (and matches?) could then be applied on this query taking a String value.
There are several options for the semantic of this String value.
For example
cookie "sessionToken" equals "abc123; Expires=Wed, 09 Jun 2021 10:18:14 GMT"
the path and domain must not be defined in the response cookie
cookie "LSID" equals "DQAAAK…Eaem_vYg; Path=/accounts; Expires=Wed, 13 Jan 2021 22:23:01 GMT; Secure; HttpOnly"
the order of attributes does not matter
cookie "LSID" matches "DQAAAK…Eaem_vYg; Path=/accounts; Expires=.*; Secure; HttpOnly"
when you need to use a regex you explicitly use the matched predicate
instead it could be easier to omit the attribute to ignore the attribute.
cookie "LSID" equals "DQAAAK…Eaem_vYg; Path=/accounts; Secure; HttpOnly"
you don't check the Expires attribute at all. It does not matter whether it is present on not.
But then, how do you check whether a cookie is a session cookie?
Another option: ´cookie´ could be extended as a query expression like jsonpath/xpath:
Check value:
cookie "toto" equals "tata"
Check expires:
cookie "toto[expires]" equals "Wed, 09 Jun 2021 10:18:14 GMT"
cookie "toto[expires]" exist
Check Path:
cookie "toto[path]" matches "/test.*"
We can borrow XPath syntax for attribute:
cookie "toto[@path]" equals "/domain"
Or we can create another type of query ´cookiepath’ and keep the actual ´cookie´ query.
Possible query syntax:
cookie "toto[expires]" exist
cookie "toto[@expires]" exist
cookie "toto.expires" exist
cookie "toto@expires" exist
=>
cookie "toto[Expires]" exist
is accepted as the syntaxPossible attributes:
Expires=
Max-Age=
Domain=
Path=
Secure
HttpOnly
SameSite=Strict
SameSite=Lax
SameSite=None
cookie "toto[max-age]" exist
cookie "toto[Max-Age]" exist
equivalentTemplate variable should probably also be supported for the cookie name.
cookie "{{cookie_name}}[Expired]"
Definition of queries in the grammar
contrary to xpath, the cookie-query is both specific to hurl and very easy.
it could be fully described as follow
The parsing implementation can choose to be a bit stricter than the grammar
for example,
rejecting escape character
cookie "toto\u{5B}Expires]"
accepting variable only for the cookie name
cookie "toto[{{field}}]"
The text was updated successfully, but these errors were encountered: