Cookies support clj-time intervals and dates #55
KushalP
commented
Mar 17, 2012
The only thing left before my work so far (see commits referenced above) can be merged in is for checks to test whether :max-age and :expires only accept Interval and DateTime objects, respectively.
How should I notify the user that they're providing incorrect data as input? What's the preferred way?
KushalP
commented
Mar 17, 2012
How should that be laid out? I was thinking about something like this:
:pre (if (and (= key :max-size) (= value (str value))
true
(instance? Interval value))
But are there better ways of laying this out?
The valid-attr? function is already used to validate the attribute via a pre-condition. You can extend the function with a conditional and more tests.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In
ring.middleware.wrap-cookies::max-agekey should support JodaTime Intervals (via clj-time):expireskey should support JodaTime DateTimes and Java DatesExisting Ring 1.0 behaviour should not be affected (i.e.
:max-ageshould handle an integer, etc.)(See: https://github.com/seancorfield/clj-time)