diff options
Diffstat (limited to 'vendor/github.com/xeipuuv/gojsonschema/jsonLoader.go')
-rw-r--r-- | vendor/github.com/xeipuuv/gojsonschema/jsonLoader.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/vendor/github.com/xeipuuv/gojsonschema/jsonLoader.go b/vendor/github.com/xeipuuv/gojsonschema/jsonLoader.go index 4f57ff789..5d88af263 100644 --- a/vendor/github.com/xeipuuv/gojsonschema/jsonLoader.go +++ b/vendor/github.com/xeipuuv/gojsonschema/jsonLoader.go @@ -33,6 +33,7 @@ import ( "io" "io/ioutil" "net/http" + "net/url" "os" "path/filepath" "runtime" @@ -145,6 +146,12 @@ func (l *jsonReferenceLoader) LoadJSON() (interface{}, error) { if reference.HasFileScheme { filename := strings.TrimPrefix(refToURL.String(), "file://") + filename, err = url.QueryUnescape(filename) + + if err != nil { + return nil, err + } + if runtime.GOOS == "windows" { // on Windows, a file URL may have an extra leading slash, use slashes // instead of backslashes, and have spaces escaped |