From e10102ce44123d39df7de740a3b96648b792a4bc Mon Sep 17 00:00:00 2001 From: Haruki Date: Sun, 27 Aug 2023 22:52:12 +0900 Subject: [PATCH] =?UTF-8?q?isExternalURL=E3=81=AE=E3=83=AD=E3=82=B8?= =?UTF-8?q?=E3=83=83=E3=82=AF=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nostrh/cmd/deploy/deploy.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/nostrh/cmd/deploy/deploy.go b/nostrh/cmd/deploy/deploy.go index 425caa0..39dbbcc 100644 --- a/nostrh/cmd/deploy/deploy.go +++ b/nostrh/cmd/deploy/deploy.go @@ -84,11 +84,6 @@ func publishEventsFromQueue() (string, error) { relays = append(relays, relay) } - // すべてのリレーへの接続に失敗した場合はエラーを返す - if len(relays) < 1 { - return "", fmt.Errorf("Failed to connect to all relay.") - } - // Publishの進捗状況を表示 allEventsCount := len(nostrEventsQueue) uploadedFilesCount := 0 @@ -133,11 +128,8 @@ func publishEventsFromQueue() (string, error) { } func isExternalURL(urlStr string) bool { - _, err := url.Parse(urlStr) - if err != nil { - return false - } - return false + u, err := url.Parse(urlStr) + return err == nil && u.Scheme != "" && u.Host != "" } func isValidFileType(str string) bool {