MCPcopy Create free account
hub / github.com/1Password/for-open-source / IsURL

Function IsURL

script/validator.go:171–182  ·  view source on GitHub ↗
(value string)

Source from the content-addressed store, hash-verified

169}
170
171func IsURL(value string) (bool, string, string) {
172 parsedURL, err := url.ParseRequestURI(value)
173 if err != nil {
174 return false, value, "is an invalid URL"
175 }
176
177 if parsedURL.Scheme != "http" && parsedURL.Scheme != "https" {
178 return false, value, "must use \"http\" or \"https\" scheme"
179 }
180
181 return true, value, ""
182}
183
184func IsChecked(value string) (bool, string, string) {
185 if value != "true" {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected