19362: Fix error when GetCollection arg is neither UUID nor PDH.
[arvados.git] / lib / controller / federation / conn.go
index ffb150bf26aa148b511f4bbde98305469ffef5df..89f68a5ef1848aab0579ace235a60c92a3c05879 100644 (file)
@@ -276,6 +276,9 @@ func (conn *Conn) CollectionGet(ctx context.Context, options arvados.GetOptions)
                }
                return c, err
        }
+       if len(options.UUID) < 34 || options.UUID[32] != '+' {
+               return arvados.Collection{}, httpErrorf(http.StatusNotFound, "invalid UUID or PDH %q", options.UUID)
+       }
        // UUID is a PDH
        first := make(chan arvados.Collection, 1)
        err := conn.tryLocalThenRemotes(ctx, options.ForwardedFor, func(ctx context.Context, remoteID string, be backend) error {