Add cgiExtension
[hcoop/domtool2.git] / src / plugins / apache.sml
index e81792a..617420a 100644 (file)
@@ -111,6 +111,15 @@ fun ssl e = case e of
              | (EApp ((EVar "use_cert", _), s), _) => Option.map SOME (Env.string s)
              | _ => NONE
 
              | (EApp ((EVar "use_cert", _), s), _) => Option.map SOME (Env.string s)
              | _ => NONE
 
+fun validExtension s =
+    size s > 0
+    andalso size s < 20
+    andalso CharVector.all (fn ch => Char.isAlphaNum ch orelse ch = #"_") s
+
+val _ = Env.type_one "file_extension"
+       Env.string
+       validExtension
+
 val defaults = [("WebPlaces",
                 (TList (TBase "web_place", dl), dl),
                 (fn () => (EList (map webPlaceDefault Config.Apache.webNodes_default), dl))),
 val defaults = [("WebPlaces",
                 (TList (TBase "web_place", dl), dl),
                 (fn () => (EList (map webPlaceDefault Config.Apache.webNodes_default), dl))),
@@ -706,6 +715,12 @@ val () = Env.action_one "unset_options"
                       app (fn opt => (write " -"; write opt)) opts;
                       write "\n"))
 
                       app (fn opt => (write " -"; write opt)) opts;
                       write "\n"))
 
+val () = Env.action_one "cgiExtension"
+        ("extension", Env.string)
+        (fn ext => (write "\tAddHandler cgi-script ";
+                    write ext;
+                    write "\n"))
+
 val () = Env.action_one "directoryIndex"
         ("filenames", Env.list Env.string)
         (fn opts =>
 val () = Env.action_one "directoryIndex"
         ("filenames", Env.list Env.string)
         (fn opts =>