Remove direct actix-http
dependency
This commit is contained in:
parent
b06f3eb32e
commit
e3153df74d
3 changed files with 14 additions and 6 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -2073,7 +2073,6 @@ name = "lemmy_routes"
|
||||||
version = "0.16.0-rc.1"
|
version = "0.16.0-rc.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"actix",
|
"actix",
|
||||||
"actix-http",
|
|
||||||
"actix-web",
|
"actix-web",
|
||||||
"actix-web-actors",
|
"actix-web-actors",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
|
|
@ -21,8 +21,7 @@ lemmy_apub = { version = "=0.16.0-rc.1", path = "../apub" }
|
||||||
diesel = "1.4.8"
|
diesel = "1.4.8"
|
||||||
actix = "0.13.0"
|
actix = "0.13.0"
|
||||||
actix-web = { version = "4.0.0", default-features = false, features = ["rustls"] }
|
actix-web = { version = "4.0.0", default-features = false, features = ["rustls"] }
|
||||||
actix-web-actors = { version = "4.0.0", default-features = false }
|
actix-web-actors = { version = "4.1.0", default-features = false }
|
||||||
actix-http = "3.0.0"
|
|
||||||
sha2 = "0.10.0"
|
sha2 = "0.10.0"
|
||||||
anyhow = "1.0.51"
|
anyhow = "1.0.51"
|
||||||
chrono = { version = "0.4.19", features = ["serde"] }
|
chrono = { version = "0.4.19", features = ["serde"] }
|
||||||
|
|
|
@ -1,5 +1,15 @@
|
||||||
use actix_http::header::{HeaderName, ACCEPT_ENCODING, HOST};
|
use actix_web::{
|
||||||
use actix_web::{body::BodyStream, http::StatusCode, web::Data, *};
|
body::BodyStream,
|
||||||
|
error,
|
||||||
|
http::{
|
||||||
|
header::{HeaderName, ACCEPT_ENCODING, HOST},
|
||||||
|
StatusCode,
|
||||||
|
},
|
||||||
|
web,
|
||||||
|
Error,
|
||||||
|
HttpRequest,
|
||||||
|
HttpResponse,
|
||||||
|
};
|
||||||
use anyhow::anyhow;
|
use anyhow::anyhow;
|
||||||
use futures::stream::{Stream, StreamExt};
|
use futures::stream::{Stream, StreamExt};
|
||||||
use lemmy_utils::{claims::Claims, rate_limit::RateLimit, LemmyError};
|
use lemmy_utils::{claims::Claims, rate_limit::RateLimit, LemmyError};
|
||||||
|
@ -11,7 +21,7 @@ use std::time::Duration;
|
||||||
|
|
||||||
pub fn config(cfg: &mut web::ServiceConfig, client: ClientWithMiddleware, rate_limit: &RateLimit) {
|
pub fn config(cfg: &mut web::ServiceConfig, client: ClientWithMiddleware, rate_limit: &RateLimit) {
|
||||||
cfg
|
cfg
|
||||||
.app_data(Data::new(client))
|
.app_data(web::Data::new(client))
|
||||||
.service(
|
.service(
|
||||||
web::resource("/pictrs/image")
|
web::resource("/pictrs/image")
|
||||||
.wrap(rate_limit.image())
|
.wrap(rate_limit.image())
|
||||||
|
|
Loading…
Reference in a new issue