Two mod_mime directives
authorAdam Chlipala <adamc@hcoop.net>
Mon, 18 Feb 2008 15:32:59 +0000 (15:32 +0000)
committerAdam Chlipala <adamc@hcoop.net>
Mon, 18 Feb 2008 15:32:59 +0000 (15:32 +0000)
lib/mod_mime.dtl [new file with mode: 0644]
src/plugins/apache.sml

diff --git a/lib/mod_mime.dtl b/lib/mod_mime.dtl
new file mode 100644 (file)
index 0000000..d46a7af
--- /dev/null
@@ -0,0 +1,12 @@
+{{Support for Apache's mod_mime}}
+
+extern val addType : no_spaces -> no_spaces -> [^Vhost];
+{{See <a href="http://httpd.apache.org/docs/2.0/mod/mod_mime.html#addtype">the
+  Apache documentation</a>.}}
+
+extern type filter;
+extern val includes : filter;
+extern val deflate : filter;
+extern val addOutputFilter : [filter] -> [no_spaces] -> [^Vhost];
+{{See <a href="http://httpd.apache.org/docs/2.0/mod/mod_mime.html#addoutputfilter">the
+  Apache documentation</a>.}}
index 450cfbb..97bfc69 100644 (file)
@@ -988,6 +988,28 @@ val () = Env.action_one "phpVersion"
                         write (Int.toString version);
                         write " .php .phtml\n"))
 
                         write (Int.toString version);
                         write " .php .phtml\n"))
 
+val () = Env.action_two "addType"
+        ("mime type", Env.string, "extension", Env.string)
+        (fn (mt, ext) => (write "\tAddType ";
+                          write mt;
+                          write " ";
+                          write ext;
+                          write "\n"))
+
+val filter = fn (EVar "includes", _) => SOME "INCLUDES"
+             | (EVar "deflate", _) => SOME "DEFLATE"
+             | _ => NONE
+
+val () = Env.action_two "addOutputFilter"
+        ("filters", Env.list filter, "extensions", Env.list Env.string)
+        (fn (f :: fs, exts as (_ :: _)) =>
+            (write "\tAddOutputFilter ";
+             write f;
+             app (fn f => (write ";"; write f)) fs;
+             app (fn ext => (write " "; write ext)) exts;
+             write "\n")
+          | _ => ())
+
 val () = Domain.registerResetLocal (fn () =>
                                       ignore (OS.Process.system (Config.rm ^ " -rf /var/domtool/vhosts/*")))
 
 val () = Domain.registerResetLocal (fn () =>
                                       ignore (OS.Process.system (Config.rm ^ " -rf /var/domtool/vhosts/*")))