~julienxx/castor

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH] Safely unwrap URL host

Details
Message ID
<20201120175857.10558-1-mark@markdain.net>
DKIM signature
missing
Download raw message
Patch: +1 -1
This commit fixes a crash that happens when the user attempts to
navigate to `gemini://'.

Castor now displays an error message:

    Could not connect to :1965
---
 src/gemini/client.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gemini/client.rs b/src/gemini/client.rs
index bf28cf7..882d81f 100644
--- a/src/gemini/client.rs
+++ b/src/gemini/client.rs
@@ -8,7 +8,7 @@ use crate::protocols::*;

pub fn get_data<T: Protocol>(url: T) -> Result<(Option<Vec<u8>>, Vec<u8>), String> {
    let url = url.get_source_url();
    let host = url.host_str().unwrap();
    let host = url.host_str().unwrap_or("");
    let port = url.port().unwrap_or(1965);
    let urlf = format!("{}:{}", host, port);

-- 
2.20.1
Details
Message ID
<e4367939-d367-8d87-9216-741210ac3180@typed-hole.org>
In-Reply-To
<20201120175857.10558-1-mark@markdain.net> (view parent)
DKIM signature
missing
Download raw message
Applied, thanks!
Reply to thread Export thread (mbox)