Skip to content
Permalink
Browse files
correctly handle file:// urls
  • Loading branch information
ahgittin committed Apr 24, 2017
1 parent 9f4224d commit 8f178805661b93dd2fb28f3ac91e7c575f1427b9
Showing 1 changed file with 4 additions and 1 deletion.
@@ -228,11 +228,14 @@ func AddCatalog(network *net.Network, resource string) (map[string]models.Catalo
}

//Only deal with the below file types
if "" != u.Scheme && "file" != u.Scheme && "http" != u.Scheme && "https" != u.Scheme{
if "" != u.Scheme && "file" != u.Scheme && "http" != u.Scheme && "https" != u.Scheme {
return nil, errors.New("Unrecognised protocol scheme: " + u.Scheme)
}

if "" == u.Scheme || "file" == u.Scheme {
if "file" == u.Scheme {
resource = u.Path
}
file, err := os.Open(filepath.Clean(resource))
if err != nil {
return nil, err

0 comments on commit 8f17880

Please sign in to comment.