Skip to content

Commit

Permalink
fix: add '-' to allowed characters in domain names
Browse files Browse the repository at this point in the history
  • Loading branch information
lyager committed Apr 30, 2024
1 parent 525d51f commit 8fdc628
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/fix-domains.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"cargo-mobile2": patch
---

Fix the domain checker to allow '-' in domain names.
3 changes: 2 additions & 1 deletion src/config/app/domain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ pub fn check_domain_syntax(domain_name: &str) -> Result<(), DomainError> {
}
let mut bad_chars = Vec::new();
for c in label.chars() {
if !c.is_ascii_alphanumeric() && !bad_chars.contains(&c) {
if !c.is_ascii_alphanumeric() && c != '-' && !bad_chars.contains(&c) {
bad_chars.push(c);
}
}
Expand All @@ -167,6 +167,7 @@ mod test {
#[rstest(
input,
case("com.example"),
case("com.exa-mple"),
case("t2900.e1.s709.t1000"),
case("kotlin.com"),
case("java.test"),
Expand Down

0 comments on commit 8fdc628

Please sign in to comment.