Skip to content

Commit

Permalink
optimise regex
Browse files Browse the repository at this point in the history
  • Loading branch information
ravi-sawlani-yral committed Jan 31, 2025
1 parent e518ea7 commit d64b519
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ssr/src/utils/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub fn is_host_or_origin_from_preview_domain(uri: &str) -> bool {
use regex::Regex;

static PR_PREVIEW_PATTERN: LazyLock<Regex> = LazyLock::new(|| {
Regex::new(r"^https://pr-\d*-yral-dapp-hot-or-not-web-leptos-ssr\.fly\.dev$|^pr-\d*-yral-dapp-hot-or-not-web-leptos-ssr\.fly\.dev$").unwrap()
Regex::new(r"^(https:\/\/)?pr-\d*-yral-dapp-hot-or-not-web-leptos-ssr\.fly\.dev$").unwrap()
});

PR_PREVIEW_PATTERN.is_match_at(uri, 0)
Expand Down

0 comments on commit d64b519

Please sign in to comment.