From d800556bd50ecb78c21343a288f9475b8b870162 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Fri, 19 Oct 2018 15:55:17 -0400 Subject: Just return None rather than crashing, when trying to read cookies within tasks (closes #143) --- tests/task_cookie.ur | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/task_cookie.ur (limited to 'tests') diff --git a/tests/task_cookie.ur b/tests/task_cookie.ur new file mode 100644 index 00000000..39f49b0a --- /dev/null +++ b/tests/task_cookie.ur @@ -0,0 +1,9 @@ +cookie myCookie: {Value: string} + +fun main (): transaction page = return + +task initialize = fn () => + c <- getCookie myCookie; + case c of + None => debug "No cookie" + | Some {Value = v} => debug ("Cookie value: " ^ v) -- cgit v1.2.3