chore: update actix-* deps

This commit is contained in:
realaravinth
2022-05-07 16:10:14 +05:30
parent 6d6b494c6f
commit 91c6f77cab
16 changed files with 1101 additions and 1006 deletions

View File

@@ -16,7 +16,7 @@
*/
use std::borrow::Cow;
use actix_web::body::AnyBody;
use actix_web::body::BoxBody;
use actix_web::{get, http::header, web, HttpResponse, Responder};
use log::debug;
use mime_guess::from_path;
@@ -82,9 +82,9 @@ struct Asset;
fn handle_assets(path: &str) -> HttpResponse {
match Asset::get(path) {
Some(content) => {
let body: AnyBody = match content.data {
Cow::Borrowed(bytes) => bytes.into(),
Cow::Owned(bytes) => bytes.into(),
let body: BoxBody = match content.data {
Cow::Borrowed(bytes) => BoxBody::new(bytes),
Cow::Owned(bytes) => BoxBody::new(bytes),
};
HttpResponse::Ok()
@@ -100,6 +100,7 @@ fn handle_assets(path: &str) -> HttpResponse {
}
}
#[get("/assets/{_:.*}")]
pub async fn static_files(path: web::Path<String>) -> impl Responder {
handle_assets(&path)
@@ -112,9 +113,9 @@ struct Favicons;
fn handle_favicons(path: &str) -> HttpResponse {
match Favicons::get(path) {
Some(content) => {
let body: AnyBody = match content.data {
Cow::Borrowed(bytes) => bytes.into(),
Cow::Owned(bytes) => bytes.into(),
let body: BoxBody = match content.data {
Cow::Borrowed(bytes) => BoxBody::new(bytes),
Cow::Owned(bytes) => BoxBody::new(bytes),
};
HttpResponse::Ok()
@@ -130,6 +131,7 @@ fn handle_favicons(path: &str) -> HttpResponse {
}
}
#[get("/{file}")]
pub async fn favicons(path: web::Path<String>) -> impl Responder {
debug!("searching favicons");