mirror of
https://github.com/studiokaiji/nostr-webhost.git
synced 2025-12-17 06:44:28 +01:00
isExternalURLのロジックを修正
This commit is contained in:
@@ -84,11 +84,6 @@ func publishEventsFromQueue() (string, error) {
|
|||||||
relays = append(relays, relay)
|
relays = append(relays, relay)
|
||||||
}
|
}
|
||||||
|
|
||||||
// すべてのリレーへの接続に失敗した場合はエラーを返す
|
|
||||||
if len(relays) < 1 {
|
|
||||||
return "", fmt.Errorf("Failed to connect to all relay.")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Publishの進捗状況を表示
|
// Publishの進捗状況を表示
|
||||||
allEventsCount := len(nostrEventsQueue)
|
allEventsCount := len(nostrEventsQueue)
|
||||||
uploadedFilesCount := 0
|
uploadedFilesCount := 0
|
||||||
@@ -133,11 +128,8 @@ func publishEventsFromQueue() (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func isExternalURL(urlStr string) bool {
|
func isExternalURL(urlStr string) bool {
|
||||||
_, err := url.Parse(urlStr)
|
u, err := url.Parse(urlStr)
|
||||||
if err != nil {
|
return err == nil && u.Scheme != "" && u.Host != ""
|
||||||
return false
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func isValidFileType(str string) bool {
|
func isValidFileType(str string) bool {
|
||||||
|
|||||||
Reference in New Issue
Block a user