diff --git a/Cargo.lock b/Cargo.lock index 487bd99..176ff21 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -727,7 +727,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "zlnk" -version = "0.4.4" +version = "0.4.5" dependencies = [ "dotenv 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "maxminddb 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index ab548a6..ac0febb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zlnk" -version = "0.4.4" +version = "0.4.5" authors = ["Jonas Kuche "] [dependencies] diff --git a/src/env_loader.rs b/src/env_loader.rs index db462d6..6b43a8e 100644 --- a/src/env_loader.rs +++ b/src/env_loader.rs @@ -14,7 +14,7 @@ pub struct Env { pub disable_stats: bool } -const URL_REGEX: &'static str = r"^(https?://)?([\da-z\.-]+)\.([a-z\.]{2,6})([/\w \.-]*)*/?$"; +const URL_REGEX: &'static str = r"https?://(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)"; pub fn init() -> Env { dotenv().ok();