Skip to content

Commit

Permalink
isExternalURLのロジックを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
studiokaiji committed Aug 27, 2023
1 parent 2f3f345 commit e10102c
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions nostrh/cmd/deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit e10102c

Please sign in to comment.