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
As per the HTTP standard guidelines, the Expires parameter of the Set-Cookie needs to be a date in the format specified by the RFC 7231 as shown in Mozilla Dev Guide
Current encode method in sanic's Cookie class though enforces this standard, it will also allow you to set any item as a valid value via an exception catcher block.
@chenjr0719 ATM, the only way I can think of to enforce the string date format to be compliant with RCF would be via the strptime method. But is it even required to support the date in string format here? I personally think having just datetime support should be fine. But @huge-success/sanic-core-devs can pitch in and suggest maybe?
Description
As per the
HTTP
standard guidelines, theExpires
parameter of theSet-Cookie
needs to be a date in the format specified by the RFC 7231 as shown in Mozilla Dev GuideCurrent
encode
method insanic
'sCookie
class though enforces this standard, it will also allow you to set any item as a valid value via an exception catcher block.Reference
encode
method inCookie
classExpected Behavior
Only a valid
datetime
object that can be converted into a RFC standard date needs to be taken as a valid itemThe text was updated successfully, but these errors were encountered: