diff src/mono_opt.sml @ 741:f7e2026dd5ae

Returning a blob as page result
author Adam Chlipala <adamc@hcoop.net>
date Sun, 26 Apr 2009 09:02:17 -0400
parents 9864b64b1700
children 8688e01ae469
line wrap: on
line diff
--- a/src/mono_opt.sml	Sat Apr 25 14:47:16 2009 -0400
+++ b/src/mono_opt.sml	Sun Apr 26 09:02:17 2009 -0400
@@ -31,6 +31,7 @@
 structure U = MonoUtil
 
 val bless = ref (fn _ : string => true)
+val blessMime = ref (CharVector.all (fn ch => Char.isAlphaNum ch orelse ch = #"-" orelse ch = #"/" orelse ch = #"."))
 
 fun typ t = t
 fun decl d = d
@@ -386,6 +387,12 @@
          else
              ErrorMsg.errorAt loc "Invalid URL passed to 'bless'";
          se)
+      | EFfiApp ("Basis", "blessMime", [(se as EPrim (Prim.String s), loc)]) =>
+        (if !blessMime s then
+             ()
+         else
+             ErrorMsg.errorAt loc "Invalid string passed to 'blessMime'";
+         se)
 
       | EFfiApp ("Basis", "checkString", [(EPrim (Prim.String s), loc)]) => 
         let