Skip to content
This repository has been archived by the owner on Aug 16, 2021. It is now read-only.

Commit

Permalink
fix non-URL manifest bug
Browse files Browse the repository at this point in the history
Anything that could be considered a partial URL in net/http is valid, even if it could only be considered a path.
In order to circumvent this we check that a host and schema have been set.

Signed-off-by: Liam White <liam@tetrate.io>
  • Loading branch information
liamawhite committed Aug 2, 2019
1 parent 8a51a1b commit 51d866d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/manifest/locate.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ type Key struct {
// The build version is searched for as a prefix of the OperatingSystemVersion.
// If the OperatingSystemVersion is empty it returns the first build listed for that operating system
func Locate(key *Key, manifestLocation string) (string, error) {
if _, err := url.Parse(manifestLocation); err != nil {
if u, err := url.Parse(manifestLocation); err != nil || u.Host == "" || u.Scheme == "" {
return "", errors.New("only URL manifest locations are supported")
}
manifest, err := fetch(manifestLocation)
Expand Down

0 comments on commit 51d866d

Please sign in to comment.