| author | Jose Quintana <joseluisquintana20@gmail.com> | 2021-05-19 9:32:26.0 +00:00:00 |
|---|---|---|
| committer | Jose Quintana <joseluisquintana20@gmail.com> | 2021-05-19 9:37:15.0 +00:00:00 |
| commit | da67063bcc3cea664608adcc860fc40f34500507 [patch] |
|
| tree | d94b11d210805746d2a3175b0309b579a1565eba |
|
| parent | 8ecc5b45fad139cfaac05e9dbaf2a94b9a3b5996 |
|
| download | da67063bcc3cea664608adcc860fc40f34500507.tar.gz |
|
refactor: boolean literal parsing for --directory-listing argument
Diff
src/config.rs | 9 +++++++-- src/server.rs | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/config.rs b/src/config.rs index 3481560..6bbda94 100644 /// Specify the file path to read the private key. pub http2_tls_key: String, long, short = "z", parse, env = "SERVER_DIRECTORY_LISTING" )] /// Enable directory listing for all requests ending with the slash character (‘/’). pub directory_listing: , pub directory_listing: bool, } diff --git a/src/server.rs b/src/server.rs index ae40d51..c04fe51 100644 // TODO: CORS support // Directory listing option let dir_listing = opts.directory_listing.unwrap_or_default; let dir_listing = opts.directory_listing; // Spawn a new Tokio asynchronous server task with its given options let threads = self.threads;