Handle an image ref with scheme
An image ref must be a scheme-less URI. A reference with scheme (such as `http://`) must return ErrInvalid. Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
This commit is contained in:
@@ -85,6 +85,10 @@ var splitRe = regexp.MustCompile(`[:@]`)
|
||||
|
||||
// Parse parses the string into a structured ref.
|
||||
func Parse(s string) (Spec, error) {
|
||||
if strings.Contains(s, "://") {
|
||||
return Spec{}, ErrInvalid
|
||||
}
|
||||
|
||||
u, err := url.Parse("dummy://" + s)
|
||||
if err != nil {
|
||||
return Spec{}, err
|
||||
|
Reference in New Issue
Block a user