Skip to content

Commit 96ac29c

Browse files
committed
fix issue with toml configuration missing url value
1 parent 00c6b41 commit 96ac29c

4 files changed

Lines changed: 8 additions & 2 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "defguard-proxy"
3-
version = "1.1.0"
3+
version = "1.1.1"
44
edition = "2021"
55
license = "Apache-2.0"
66
homepage = "https://github.com/DefGuard/proxy"

example-config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ grpc_port = 50051
1616
log_level = "info"
1717
rate_limit_per_second = 0
1818
rate_limit_burst = 0
19+
url = "http://localhost:8080"

src/config.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ use log::LevelFilter;
55
use serde::Deserialize;
66
use url::Url;
77

8+
fn default_url() -> Url {
9+
Url::parse("http://localhost:8080").unwrap()
10+
}
11+
812
#[derive(Parser, Debug, Deserialize)]
913
#[command(version)]
1014
pub struct Config {
@@ -42,6 +46,7 @@ pub struct Config {
4246
value_parser = Url::parse,
4347
default_value = "http://localhost:8080"
4448
)]
49+
#[serde(default = "default_url")]
4550
pub url: Url,
4651

4752
/// Configuration file path

0 commit comments

Comments
 (0)