From 057d6401ab53ab690d94302ef7ea22ad335fe0e4 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Tue, 26 Nov 2019 19:23:48 -0600 Subject: [PATCH] feat(bin): disable uploading by default --- src/bin/http_of_dir.ml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/bin/http_of_dir.ml b/src/bin/http_of_dir.ml index 792e6132..a3b128d4 100644 --- a/src/bin/http_of_dir.ml +++ b/src/bin/http_of_dir.ml @@ -15,7 +15,7 @@ let default_config () : config = { addr="127.0.0.1"; port=8080; delete=false; - upload=true; + upload=false; max_upload_size = 10 * 1024 * 1024; j=32; } @@ -203,10 +203,11 @@ let main () = "--port", Int (fun x -> config.port <- x), " port to listen on"; "-p", Int (fun x -> config.port <- x), " alias to --port"; "--dir", Set_string dir_, " directory to serve (default: \".\")"; + "--debug", Unit (fun () -> S._enable_debug true), " debug mode"; + "--upload", Unit (fun () -> config.upload <- true), " enable file uploading"; "--no-upload", Unit (fun () -> config.upload <- false), " disable file uploading"; "--max-upload", String (fun i -> config.max_upload_size <- parse_size i), - "maximum size of files that can be uploaded"; - "--debug", Unit (fun () -> S._enable_debug true), " debug mode"; + " maximum size of files that can be uploaded"; "--delete", Unit (fun () -> config.delete <- true), " enable `delete` on files"; "--no-delete", Unit (fun () -> config.delete <- false), " disable `delete` on files"; "-j", Int (fun j->config.j <- j), " maximum number of simultaneous connections";