diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/git/nostr_url.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/git/nostr_url.rs b/src/lib/git/nostr_url.rs index 39ce60e..ca616a0 100644 --- a/src/lib/git/nostr_url.rs +++ b/src/lib/git/nostr_url.rs | |||
| @@ -136,7 +136,9 @@ impl NostrUrlDecoded { | |||
| 136 | // extract optional protocol | 136 | // extract optional protocol |
| 137 | if protocol.is_none() { | 137 | if protocol.is_none() { |
| 138 | let part = parts.first().context(INCORRECT_NOSTR_URL_FORMAT_ERROR)?; | 138 | let part = parts.first().context(INCORRECT_NOSTR_URL_FORMAT_ERROR)?; |
| 139 | let protocol_str = if let Some(at_index) = part.find('@') { | 139 | let protocol_str = if part.contains('.') { |
| 140 | part | ||
| 141 | } else if let Some(at_index) = part.find('@') { | ||
| 140 | user = Some(part[..at_index].to_string()); | 142 | user = Some(part[..at_index].to_string()); |
| 141 | &part[at_index + 1..] | 143 | &part[at_index + 1..] |
| 142 | } else { | 144 | } else { |
| @@ -147,7 +149,7 @@ impl NostrUrlDecoded { | |||
| 147 | "https" => Some(ServerProtocol::Https), | 149 | "https" => Some(ServerProtocol::Https), |
| 148 | "http" => Some(ServerProtocol::Http), | 150 | "http" => Some(ServerProtocol::Http), |
| 149 | "git" => Some(ServerProtocol::Git), | 151 | "git" => Some(ServerProtocol::Git), |
| 150 | _ => protocol, | 152 | _ => None, |
| 151 | }; | 153 | }; |
| 152 | if protocol.is_some() { | 154 | if protocol.is_some() { |
| 153 | parts.remove(0); | 155 | parts.remove(0); |