This commit fixes a crash that happens when the user attempts to
navigate to `gemini://'
With this fix, Asuka now displays an error message:
Could not connect to :1965
failed to lookup address information: Name or service not known
---
src/content.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/content.rs b/src/content.rs
index 184d9e4..02fdc41 100644
--- a/src/content.rs
+++ b/src/content.rs
@@ -6,7 +6,7 @@ use std::net::{TcpStream, ToSocketAddrs};
use std::time::Duration;
pub fn get_data(url: &url::Url) -> Result<(Vec<u8>, Vec<u8>), String> {
- let host = url.host_str().unwrap();
+ let host = url.host_str().unwrap_or("");
let urlf = format!("{}:1965", host);
let mut builder = TlsConnector::builder();
--
2.30.1