File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,16 @@ pub use uts46::{Config, Errors};
50
50
///
51
51
/// This process may fail.
52
52
pub fn domain_to_ascii ( domain : & str ) -> Result < String , uts46:: Errors > {
53
- uts46:: Config :: default ( ) . to_ascii ( domain)
53
+ Config :: default ( ) . to_ascii ( domain)
54
+ }
55
+
56
+ /// The [domain to ASCII](https://url.spec.whatwg.org/#concept-domain-to-ascii) algorithm,
57
+ /// with the `beStrict` flag set.
58
+ pub fn domain_to_ascii_strict ( domain : & str ) -> Result < String , uts46:: Errors > {
59
+ Config :: default ( )
60
+ . use_std3_ascii_rules ( true )
61
+ . verify_dns_length ( true )
62
+ . to_ascii ( domain)
54
63
}
55
64
56
65
/// The [domain to Unicode](https://url.spec.whatwg.org/#concept-domain-to-unicode) algorithm.
@@ -62,5 +71,5 @@ pub fn domain_to_ascii(domain: &str) -> Result<String, uts46::Errors> {
62
71
/// This may indicate [syntax violations](https://url.spec.whatwg.org/#syntax-violation)
63
72
/// but always returns a string for the mapped domain.
64
73
pub fn domain_to_unicode ( domain : & str ) -> ( String , Result < ( ) , uts46:: Errors > ) {
65
- uts46 :: Config :: default ( ) . to_unicode ( domain)
74
+ Config :: default ( ) . to_unicode ( domain)
66
75
}
You can’t perform that action at this time.
0 commit comments