Skip to content

Commit

Permalink
Use compression middleware (#3343)
Browse files Browse the repository at this point in the history
  • Loading branch information
dullbananas authored Jun 26, 2023
1 parent 73d2faa commit b2a9d4a
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 1 deletion.
81 changes: 81 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ diesel_migrations = "2.1.0"
diesel-async = "0.3.1"
serde = { version = "1.0.164", features = ["derive"] }
serde_with = "1.14.0"
actix-web = { version = "4.3.1", default-features = false, features = ["macros", "rustls"] }
actix-web = { version = "4.3.1", default-features = false, features = ["macros", "rustls", "compress-brotli", "compress-gzip", "compress-zstd"] }
tracing = "0.1.37"
tracing-actix-web = { version = "0.6.2", default-features = false }
tracing-error = "0.2.0"
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ pub async fn start_lemmy_server() -> Result<(), LemmyError> {
// This is the default log format save for the usage of %{r}a over %a to guarantee to record the client's (forwarded) IP and not the last peer address, since the latter is frequently just a reverse proxy
"%{r}a '%r' %s %b '%{Referer}i' '%{User-Agent}i' %T",
))
.wrap(middleware::Compress::default())
.wrap(cors_config)
.wrap(TracingLogger::<QuieterRootSpanBuilder>::new())
.app_data(Data::new(context.clone()))
Expand Down

0 comments on commit b2a9d4a

Please sign in to comment.