diff options
Diffstat (limited to 'stdlib/source/library/lux/world/net/http/cookie.lux')
-rw-r--r-- | stdlib/source/library/lux/world/net/http/cookie.lux | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/stdlib/source/library/lux/world/net/http/cookie.lux b/stdlib/source/library/lux/world/net/http/cookie.lux index 1254923b8..2c5965338 100644 --- a/stdlib/source/library/lux/world/net/http/cookie.lux +++ b/stdlib/source/library/lux/world/net/http/cookie.lux @@ -20,18 +20,19 @@ ["." // (#+ Header) ["." header]]) -(type: #export Directive (-> Text Text)) +(type: #export Directive + (-> Text Text)) (def: (directive extension) (-> Text Directive) - (function (_ so-far) - (format so-far "; " extension))) + (function (_ so_far) + (format so_far "; " extension))) (def: #export (set name value) (-> Text Text Header) (header.add "Set-Cookie" (format name "=" value))) -(def: #export (max-age duration) +(def: #export (max_age duration) (-> Duration Directive) (let [seconds (duration.query duration.second duration)] (..directive (format "Max-Age=" (if (i.< +0 seconds) @@ -53,15 +54,15 @@ (..directive <tag>))] [secure "Secure"] - [http-only "HttpOnly"] + [http_only "HttpOnly"] ) -(type: #export CSRF-Policy +(type: #export CSRF_Policy #Strict #Lax) -(def: #export (same-site policy) - (-> CSRF-Policy Directive) +(def: #export (same_site policy) + (-> CSRF_Policy Directive) (..directive (format "SameSite=" (case policy #Strict "Strict" #Lax "Lax")))) @@ -69,9 +70,9 @@ (def: (cookie context) (-> Context (Parser Context)) (do p.monad - [key (l.slice (l.many! (l.none-of! "="))) + [key (l.slice (l.many! (l.none_of! "="))) _ (l.this "=") - value (l.slice (l.many! (l.none-of! ";")))] + value (l.slice (l.many! (l.none_of! ";")))] (in (dictionary.put key value context)))) (def: (cookies context) |