diff --git a/default.go b/default.go index 616d639..52d4077 100644 --- a/default.go +++ b/default.go @@ -58,6 +58,10 @@ func (api *LinkInfoApi) DefaultLinkHandler(link string) (*LinkInfo, error) { return nil, err } + if u.Scheme != "http" && u.Scheme != "https" { + return nil, errors.New("unsupported scheme") + } + if u.Host == "localhost" { return nil, errors.New("url is localhost") } else if ip := net.ParseIP(u.Host); ip != nil && isPrivateIP(ip) {