From 4d6ddb512a91d2570ba39e74b67a583586023148 Mon Sep 17 00:00:00 2001 From: blakelauer Date: Thu, 3 Nov 2016 21:00:47 +1000 Subject: [PATCH] Allow a path of rev: or id: for get comands The API allows for the download (get) command to use "path": "rev:a1c10ce0dd78" or "path": "id:a4ayc_80_OEAAAAAAAAAYa" but the validatePath function adds "/" to the path if it is not there. This results in "path": "/rev:a1c10ce0dd78" and an error. --- cmd/root.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/root.go b/cmd/root.go index ac76df5..93153be 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -78,7 +78,7 @@ func oauthConfig(tokenType string, domain string) *oauth2.Config { func validatePath(p string) (path string, err error) { path = p - if !strings.HasPrefix(path, "/") { + if !strings.HasPrefix(path, "/") && !strings.HasPrefix(path, "rev:") && !strings.HasPrefix(path, "id:") { path = fmt.Sprintf("/%s", path) }