diff tests/url.ur @ 770:c125df6fabfc

Runtime URL and MIME type filtering
author Adam Chlipala <adamc@hcoop.net>
date Sat, 02 May 2009 18:20:15 -0400
parents e28637743279
children
line wrap: on
line diff
--- a/tests/url.ur	Sat May 02 13:37:52 2009 -0400
+++ b/tests/url.ur	Sat May 02 18:20:15 2009 -0400
@@ -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>