feat: make compression optional
Diff
src/bin/server.rs | 3 ++-
src/core/config.rs | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
@@ -62,7 +62,7 @@ async fn server(opts: config::Options) -> Result {
)
.run((host, port)),
),
_ => tokio::task::spawn(
"gzip" => tokio::task::spawn(
warp::serve(
public_head.or(warp::get()
.and(accept_encoding("gzip"))
@@ -76,6 +76,7 @@ async fn server(opts: config::Options) -> Result {
)
.run((host, port)),
),
_ => tokio::task::spawn(warp::serve(public_head.or(public_get_default)).run((host, port))),
};
signals::wait(|sig: signals::Signal| {
@@ -16,7 +16,8 @@ pub struct Options {
pub root: String,
#[structopt(long, short = "c", default_value = "gzip", env = "SERVER_COMPRESSION")]
pub compression: String,
#[structopt(long, short = "l", default_value = "error", env = "SERVER_LOG_LEVEL")]