Mercurial > urweb
annotate tests/cookieClear.ur @ 2139:8c81cd351c1a
Allow URIs specified in file directives implicitly
It seems to me that, by specifying that one wants to serve a given
file at a specified URI, one is implying that this URI should be
allowed.
author | Julian Squires <julian@cipht.net> |
---|---|
date | Fri, 24 Apr 2015 16:21:55 -0400 |
parents | bd6c90f5a428 |
children |
rev | line source |
---|---|
adam@1423 | 1 cookie c : int |
adam@1423 | 2 |
adam@1423 | 3 fun setit () = |
adam@1423 | 4 setCookie c {Value = 13, |
adam@1423 | 5 Expires = None, |
adam@1423 | 6 Secure = False}; |
adam@1423 | 7 return <xml/> |
adam@1423 | 8 |
adam@1423 | 9 fun doit () = |
adam@1423 | 10 ro <- getCookie c; |
adam@1423 | 11 clearCookie c; |
adam@1423 | 12 case ro of |
adam@1423 | 13 None => return <xml>None</xml> |
adam@1423 | 14 | Some v => return <xml>Some {[v]}</xml> |
adam@1423 | 15 |
adam@1423 | 16 fun main () = return <xml><body> |
adam@1423 | 17 <form><submit value="Set it!" action={setit}/></form> |
adam@1423 | 18 <form><submit value="Get busy!" action={doit}/></form> |
adam@1423 | 19 </body></xml> |