mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-06 03:05:29 -05:00
restore previous behavior for http_of_dir
This commit is contained in:
parent
bf2bf6832d
commit
5735f813a5
1 changed files with 6 additions and 7 deletions
|
|
@ -20,7 +20,8 @@ let parse_size s : int =
|
||||||
with _ -> raise (Arg.Bad "invalid size (expected <int>[kM]?)")
|
with _ -> raise (Arg.Bad "invalid size (expected <int>[kM]?)")
|
||||||
|
|
||||||
let main () =
|
let main () =
|
||||||
let config = D.default_config () in
|
let config = D.default_config() in
|
||||||
|
config.dir_behavior <- Index_or_lists; (* keep old behavior *)
|
||||||
let dir_ = ref "." in
|
let dir_ = ref "." in
|
||||||
let addr = ref "127.0.0.1" in
|
let addr = ref "127.0.0.1" in
|
||||||
let port = ref 8080 in
|
let port = ref 8080 in
|
||||||
|
|
@ -38,12 +39,10 @@ let main () =
|
||||||
"--no-download", Unit (fun () -> config.download <- false), " disable file downloading";
|
"--no-download", Unit (fun () -> config.download <- false), " disable file downloading";
|
||||||
"--max-upload", String (fun i -> config.max_upload_size <- parse_size i),
|
"--max-upload", String (fun i -> config.max_upload_size <- parse_size i),
|
||||||
" maximum size of files that can be uploaded";
|
" maximum size of files that can be uploaded";
|
||||||
"--auto-index", Unit (fun () -> config.dir_behavior <- Index),
|
"--auto-index",
|
||||||
" automatically redirect to index.html if present";
|
Bool (fun b -> config.dir_behavior <-
|
||||||
"--list-dir", Unit (fun () -> config.dir_behavior <- Lists),
|
(if b then Index_or_lists else Lists)),
|
||||||
" automatically lists directory";
|
" <bool> automatically redirect to index.html if present";
|
||||||
"--index-and-list", Unit (fun () -> config.dir_behavior <- Index_or_lists),
|
|
||||||
" automatically redirect to index.html or lists directory";
|
|
||||||
"--delete", Unit (fun () -> config.delete <- true), " enable `delete` on files";
|
"--delete", Unit (fun () -> config.delete <- true), " enable `delete` on files";
|
||||||
"--no-delete", Unit (fun () -> config.delete <- false), " disable `delete` on files";
|
"--no-delete", Unit (fun () -> config.delete <- false), " disable `delete` on files";
|
||||||
"-j", Set_int j, " maximum number of simultaneous connections";
|
"-j", Set_int j, " maximum number of simultaneous connections";
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue