damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

commit 8a473885c7077c438d795fd0534e737b9570e7ff
parent ba1c2cd2b942d982c3bad860bfed4fcd6ce3c990
Author: William Casarin <jb55@jb55.com>
Date:   Tue,  4 Apr 2023 20:10:30 -0700

Don't add https:// prefix to empty website urls

Diffstat:
Mdamus/Nostr/Nostr.swift | 3+++
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git a/damus/Nostr/Nostr.swift b/damus/Nostr/Nostr.swift @@ -98,6 +98,9 @@ struct Profile: Codable { } var website_url: URL? { + if self.website?.trimmingCharacters(in: .whitespacesAndNewlines) == "" { + return nil + } return self.website.flatMap { url in let trim = url.trimmingCharacters(in: .whitespacesAndNewlines) if !(trim.hasPrefix("http://") || trim.hasPrefix("https://")) {