Sha256: b22b51cdd6e14b810db1ed0c880d05625617f75ee188c5d73d3943d3df3014fa
Contents?: true
Size: 797 Bytes
Versions: 16
Compression:
Stored size: 797 Bytes
Contents
package gosnowflake import ( "net/url" "regexp" ) var ( matcher, _ = regexp.Compile(`^http(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z@:])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\&\(\)\/\\\+&%\$#_=@]*)?$`) ) func isValidURL(targetURL string) bool { if !matcher.MatchString(targetURL) { logger.Infof(" The provided URL is not a valid URL - " + targetURL) return false } return true } func urlEncode(targetString string) string { // We use QueryEscape instead of PathEscape here // for consistency across Drivers. For example: // QueryEscape escapes space as "+" whereas PE // it as %20F. PE also does not escape @ or & // either but QE does. // The behavior of QE in Golang is more in sync // with URL encoders in Python and Java hence the choice return url.QueryEscape(targetString) }
Version data entries
16 entries across 16 versions & 1 rubygems