Skip to content

Commit

Permalink
Add debug information for the parsing
Browse files Browse the repository at this point in the history
to make troubleshooting easier
  • Loading branch information
proditis committed May 19, 2022
1 parent 0907ced commit b3f5b96
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions conf/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,13 @@ type Conf struct {
// Check if string is a url
func isExternalURL(url string) bool {
if _, err := netUrl.ParseRequestURI(url); err != nil {
log.Debugf("ParseRequestedURI: %s failed to parse with error %v", url, err)
return false
}

parts, err := netUrl.Parse(url)
if err != nil || parts.Host == "" || !strings.HasPrefix(parts.Scheme, "http") {
log.Debugf("Parse: %s failed Scheme: %s, Host: %s (err: %v)", url, parts.Scheme, parts.Host, err)
return false
}

Expand Down

0 comments on commit b3f5b96

Please sign in to comment.