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};
5050///
5151/// This process may fail.
5252pub 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)
5463}
5564
5665/// 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> {
6271/// This may indicate [syntax violations](https://url.spec.whatwg.org/#syntax-violation)
6372/// but always returns a string for the mapped domain.
6473pub fn domain_to_unicode ( domain : & str ) -> ( String , Result < ( ) , uts46:: Errors > ) {
65- uts46 :: Config :: default ( ) . to_unicode ( domain)
74+ Config :: default ( ) . to_unicode ( domain)
6675}
You can’t perform that action at this time.
0 commit comments