summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-05-02 18:20:15 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-05-02 18:20:15 -0400
commit2d37bf0ef2c634819293a191eff9799934b08346 (patch)
tree0baf5761c294a6cf6f12d93b16849bec6a4eb9cd /tests
parent20d3fa9974879189544b752e43842a67c1fec0b9 (diff)
Runtime URL and MIME type filtering
Diffstat (limited to 'tests')
-rw-r--r--tests/url.ur9
-rw-r--r--tests/url.urp3
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/url.ur b/tests/url.ur
index c45681e0..ea236502 100644
--- a/tests/url.ur
+++ b/tests/url.ur
@@ -1,12 +1,11 @@
-val url = "http://www.yahoo.com/"
-
fun readersChoice r = return <xml><body>
- <a href={bless r.Url}>Your pick, boss</a>
+ {case checkUrl r.Url of
+ None => <xml>I can't do that, Dave.</xml>
+ | Some url => <xml><a href={url}>Your pick, boss</a></xml>}
</body></xml>
fun main () : transaction page = return <xml><body>
- <a href="http://www.google.com/">Google!</a>
- <a href={bless url}>Yahoo!</a><br/>
+ <a href="http://en.wikipedia.org/wiki/Wikipedia:About">Learn</a>
<br/>
<form><textbox{#Url}/> <submit action={readersChoice}/></form>
diff --git a/tests/url.urp b/tests/url.urp
index ab5ec1b7..aaa84900 100644
--- a/tests/url.urp
+++ b/tests/url.urp
@@ -1,4 +1,5 @@
debug
-allow url http://*
+deny url http://en.wikipedia.org/wiki/Perl
+allow url http://en.wikipedia.org/*
url