|
|
@@ -9,6 +9,7 @@
|
|
|
use crate::host::Host;
|
|
|
use crate::parser::default_port;
|
|
|
use crate::Url;
|
|
|
+#[cfg(feature = "idna")]
|
|
|
use idna::domain_to_unicode;
|
|
|
use std::sync::atomic::{AtomicUsize, Ordering};
|
|
|
|
|
|
@@ -93,7 +94,11 @@ impl Origin {
|
|
|
Origin::Tuple(ref scheme, ref host, port) => {
|
|
|
let host = match *host {
|
|
|
Host::Domain(ref domain) => {
|
|
|
+ #[cfg(feature = "idna")]
|
|
|
let (domain, _errors) = domain_to_unicode(domain);
|
|
|
+ #[cfg(not(feature = "idna"))]
|
|
|
+ let domain = domain.clone();
|
|
|
+
|
|
|
Host::Domain(domain)
|
|
|
}
|
|
|
_ => host.clone(),
|