diff --git a/humphrey-server/Cargo.toml b/humphrey-server/Cargo.toml index f41fb63..0824573 100644 --- a/humphrey-server/Cargo.toml +++ b/humphrey-server/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "humphrey_server" -version = "0.4.0" +version = "0.4.1" edition = "2018" license = "MIT" homepage = "https://github.com/w-henderson/Humphrey" diff --git a/humphrey-server/src/config/config.rs b/humphrey-server/src/config/config.rs index 625efd1..c9fa1b4 100644 --- a/humphrey-server/src/config/config.rs +++ b/humphrey-server/src/config/config.rs @@ -43,7 +43,7 @@ pub struct Config { } /// Represents the configuration for a specific host. -#[derive(Debug, Default, PartialEq)] +#[derive(Debug, PartialEq)] pub struct HostConfig { /// Wildcard string specifying what hosts to match, e.g. `*.example.com` pub matches: String, diff --git a/humphrey-server/src/config/default.rs b/humphrey-server/src/config/default.rs index daf3a6c..654342d 100644 --- a/humphrey-server/src/config/default.rs +++ b/humphrey-server/src/config/default.rs @@ -1,7 +1,7 @@ //! Provides default values for the configuration. use crate::config::{ - BlacklistConfig, BlacklistMode, Config, LoggingConfig, RouteConfig, RouteType, + BlacklistConfig, BlacklistMode, Config, HostConfig, LoggingConfig, RouteConfig, RouteType, }; use crate::server::logger::LogLevel; @@ -14,7 +14,7 @@ impl Default for Config { #[cfg(feature = "tls")] tls_config: None, default_websocket_proxy: None, - hosts: vec![Default::default()], + hosts: Vec::new(), default_host: Default::default(), #[cfg(feature = "plugins")] plugins: Vec::new(), @@ -25,6 +25,15 @@ impl Default for Config { } } +impl Default for HostConfig { + fn default() -> Self { + Self { + matches: "*".into(), + routes: vec![Default::default()], + } + } +} + impl Default for RouteConfig { fn default() -> Self { Self { diff --git a/humphrey/Cargo.toml b/humphrey/Cargo.toml index cff1e70..97bd6c5 100644 --- a/humphrey/Cargo.toml +++ b/humphrey/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "humphrey" -version = "0.4.1" +version = "0.4.2" edition = "2018" license = "MIT" homepage = "https://github.com/w-henderson/Humphrey"