Disable preview option in prompts if URL size is too long

This commit is contained in:
Cristian Dominguez 2021-03-20 18:46:10 -03:00 committed by Mislav Marohnić
parent d22e72a373
commit fb39c38c85
6 changed files with 100 additions and 42 deletions

View file

@ -78,3 +78,8 @@ func DisplayURL(urlStr string) string {
}
return u.Hostname() + u.Path
}
// Maximum length of a URL: 8192 bytes
func ValidURL(urlStr string) bool {
return len(urlStr) < 8192
}