diff options
author | Adam Chlipala <adam@chlipala.net> | 2011-05-29 14:29:26 -0400 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2011-05-29 14:29:26 -0400 |
commit | 5b421885fdfad728ab584ef15ec1873ec3bc2a05 (patch) | |
tree | 02dc2d6caca935269cf3c6f523ad087c80d9c778 /tests | |
parent | f92289880fd8457a080e150cb50f0fa2af3eff9c (diff) |
getHeader and setHeader
Diffstat (limited to 'tests')
-rw-r--r-- | tests/headers.ur | 11 | ||||
-rw-r--r-- | tests/headers.urp | 5 | ||||
-rw-r--r-- | tests/headers.urs | 1 |
3 files changed, 17 insertions, 0 deletions
diff --git a/tests/headers.ur b/tests/headers.ur new file mode 100644 index 00000000..afb1565f --- /dev/null +++ b/tests/headers.ur @@ -0,0 +1,11 @@ +fun action () = + setHeader (blessResponseHeader "Location") "http://www.google.com/"; + return <xml/> + +fun main () = + ag <- getHeader (blessRequestHeader "User-Agent"); + return <xml><body> + User agent: {[ag]} + + <form> <submit action={action}/> </form> + </body></xml> diff --git a/tests/headers.urp b/tests/headers.urp new file mode 100644 index 00000000..c5fdfc99 --- /dev/null +++ b/tests/headers.urp @@ -0,0 +1,5 @@ +rewrite url Headers/* +allow requestHeader User-Agent +allow responseHeader Location + +headers diff --git a/tests/headers.urs b/tests/headers.urs new file mode 100644 index 00000000..6ac44e0b --- /dev/null +++ b/tests/headers.urs @@ -0,0 +1 @@ +val main : unit -> transaction page |