Преглед изворни кода

Now using port_or_default to get the port of a URL for the origin method

Keith Yeung пре 11 година
родитељ
комит
aec7d49de8
1 измењених фајлова са 2 додато и 1 уклоњено
  1. 2 1
      src/lib.rs

+ 2 - 1
src/lib.rs

@@ -581,7 +581,8 @@ impl Url {
                 }
             },
             "ftp" | "gopher" | "http" | "https" | "ws" | "wss" => {
-                Origin::Tuple(self.scheme.clone(), self.host().unwrap().clone(), self.port().unwrap())
+                Origin::Tuple(self.scheme.clone(), self.host().unwrap().clone(),
+                    self.port_or_default().unwrap())
             },
             // TODO: Figure out what to do if the scheme is a file
             "file" => Origin::UID(Uuid::new_v4().to_string()),