]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/getter/http_getter_common.ml
ocaml 3.09 transition
[helm.git] / helm / ocaml / getter / http_getter_common.ml
index c85f680c28fa49fe7eb87aeb78eeacc90a5576bd..d56cf6909dcb6867bd576c60bddea372f414aea4 100644 (file)
@@ -115,14 +115,14 @@ let return_file
   ~fname ?contype ?contenc ?patch_fun ?(gunzip = false) ?(via_http = true)
   ~enc outchan
 =
-  let headers =
-    match (contype, contenc) with
-    | (Some t, Some e) -> ["Content-Encoding", e; "Content-Type", t]
-    | (Some t, None) -> ["Content-Type" , t]
-    | (None, Some e) -> ["Content-Encoding", e]
-    | (None, None) -> []
-  in
   if via_http then begin
+    let headers =
+      match (contype, contenc) with
+      | (Some t, Some e) -> ["Content-Encoding", e; "Content-Type", t]
+      | (Some t, None) -> ["Content-Type" , t]
+      | (None, Some e) -> ["Content-Encoding", e]
+      | (None, None) -> []
+    in
     Http_daemon.send_basic_headers ~code:(`Code 200) outchan;
     Http_daemon.send_headers headers outchan;
     Http_daemon.send_CRLF outchan