aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven-Hendrik Haase <svenstaro@gmail.com>2024-06-09 22:38:45 +0000
committerSven-Hendrik Haase <svenstaro@gmail.com>2024-06-09 22:38:45 +0000
commitaed776ac49cb44705463d9e43c070dc56adaaae3 (patch)
tree98c318fd6f9e2718dd3eb634e9477d6151674d85
parentBump deps (diff)
downloadminiserve-aed776ac49cb44705463d9e43c070dc56adaaae3.tar.gz
miniserve-aed776ac49cb44705463d9e43c070dc56adaaae3.zip
Remove explicit dependency on http
We now use the one supplied by actix-web.
-rw-r--r--Cargo.lock1
-rw-r--r--Cargo.toml1
-rw-r--r--src/args.rs2
-rw-r--r--src/config.rs2
-rw-r--r--src/listing.rs6
-rw-r--r--src/renderer.rs3
-rw-r--r--tests/auth_file.rs2
-rw-r--r--tests/serve_request.rs2
8 files changed, 9 insertions, 10 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 5ee0a60..20bce99 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1703,7 +1703,6 @@ dependencies = [
"futures",
"grass",
"hex",
- "http",
"httparse",
"if-addrs",
"libflate",
diff --git a/Cargo.toml b/Cargo.toml
index b18b7e2..7cd503d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -37,7 +37,6 @@ fast_qr = { version = "0.12", features = ["svg"] }
futures = "0.3"
grass = { version = "0.13", features = ["macro"], default-features = false }
hex = "0.4"
-http = "0.2"
httparse = "1"
if-addrs = "0.12"
libflate = "2"
diff --git a/src/args.rs b/src/args.rs
index 95c8bff..20be079 100644
--- a/src/args.rs
+++ b/src/args.rs
@@ -1,8 +1,8 @@
use std::net::IpAddr;
use std::path::PathBuf;
+use actix_web::http::header::{HeaderMap, HeaderName, HeaderValue};
use clap::{Parser, ValueEnum, ValueHint};
-use http::header::{HeaderMap, HeaderName, HeaderValue};
use crate::auth;
use crate::listing::{SortingMethod, SortingOrder};
diff --git a/src/config.rs b/src/config.rs
index 3643502..5a0037b 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -5,8 +5,8 @@ use std::{
path::PathBuf,
};
+use actix_web::http::header::HeaderMap;
use anyhow::{anyhow, Context, Result};
-use http::HeaderMap;
#[cfg(feature = "tls")]
use rustls_pemfile as pemfile;
diff --git a/src/listing.rs b/src/listing.rs
index e24b41c..6c67051 100644
--- a/src/listing.rs
+++ b/src/listing.rs
@@ -3,7 +3,9 @@ use std::io;
use std::path::{Component, Path};
use std::time::SystemTime;
-use actix_web::{dev::ServiceResponse, web::Query, HttpMessage, HttpRequest, HttpResponse};
+use actix_web::{
+ dev::ServiceResponse, http::Uri, web::Query, HttpMessage, HttpRequest, HttpResponse,
+};
use bytesize::ByteSize;
use clap::ValueEnum;
use comrak::{markdown_to_html, ComrakOptions};
@@ -173,7 +175,7 @@ pub fn directory_listing(
let base = Path::new(serve_path);
let random_route_abs = format!("/{}", conf.route_prefix);
let abs_uri = {
- let res = http::Uri::builder()
+ let res = Uri::builder()
.scheme(req.connection_info().scheme())
.authority(req.connection_info().host())
.path_and_query(req.uri().to_string())
diff --git a/src/renderer.rs b/src/renderer.rs
index 3935d98..7896dc3 100644
--- a/src/renderer.rs
+++ b/src/renderer.rs
@@ -1,6 +1,6 @@
use std::time::SystemTime;
-use actix_web::http::StatusCode;
+use actix_web::http::{StatusCode, Uri};
use chrono::{DateTime, Local};
use chrono_humanize::Humanize;
use clap::{crate_name, crate_version, ValueEnum};
@@ -9,7 +9,6 @@ use fast_qr::{
qr::QRCodeError,
QRBuilder,
};
-use http::Uri;
use maud::{html, Markup, PreEscaped, DOCTYPE};
use strum::{Display, IntoEnumIterator};
diff --git a/tests/auth_file.rs b/tests/auth_file.rs
index ddc9e25..372c695 100644
--- a/tests/auth_file.rs
+++ b/tests/auth_file.rs
@@ -1,7 +1,7 @@
mod fixtures;
+use actix_web::http::StatusCode;
use fixtures::{server, server_no_stderr, Error, FILES};
-use http::StatusCode;
use reqwest::blocking::Client;
use rstest::rstest;
use select::document::Document;
diff --git a/tests/serve_request.rs b/tests/serve_request.rs
index b7359c3..dd25a3f 100644
--- a/tests/serve_request.rs
+++ b/tests/serve_request.rs
@@ -1,12 +1,12 @@
mod fixtures;
+use actix_web::http::StatusCode;
use assert_cmd::prelude::*;
use assert_fs::fixture::TempDir;
use fixtures::{
port, server, server_no_stderr, tmpdir, Error, TestServer, DIRECTORIES, FILES,
HIDDEN_DIRECTORIES, HIDDEN_FILES,
};
-use http::StatusCode;
use regex::Regex;
use rstest::rstest;
use select::{document::Document, node::Node, predicate::Attr};