From f1c04ad4b8ee32736c58d2e94d79e78b555bc4ab Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Fri, 13 Nov 2020 12:12:49 -0800 Subject: [PATCH] fix: no reason to look for file extensions (#3490) fixes #3489 --- cmd/policy-main.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/cmd/policy-main.go b/cmd/policy-main.go index 62130d99..2a99092d 100644 --- a/cmd/policy-main.go +++ b/cmd/policy-main.go @@ -22,7 +22,6 @@ import ( "io" "net/url" "os" - "path/filepath" "strings" "github.com/fatih/color" @@ -77,7 +76,7 @@ EXAMPLES: 3. Set bucket to "upload" on Amazon S3 cloud storage. {{.Prompt}} {{.HelpName}} set upload s3/incoming - 4. Set policy to "public" for bucket with prefix on Amazon S3 cloud storage. + 4. Set policy to "public" for bucket with prefix on Amazon S3 cloud storage. {{.Prompt}} {{.HelpName}} set public s3/public-commons/images 5. Set a custom prefix based bucket policy on Amazon S3 cloud storage using a JSON file. @@ -85,7 +84,7 @@ EXAMPLES: 6. Get bucket permissions. {{.Prompt}} {{.HelpName}} get s3/shared - + 7. Get bucket permissions in JSON format. {{.Prompt}} {{.HelpName}} get-json s3/shared @@ -209,12 +208,6 @@ func checkPolicySyntax(ctx *cli.Context) { if argsLength != 3 { cli.ShowCommandHelpAndExit(ctx, "policy", 1) } - // Validate the type of input file - if filepath.Ext(string(secondArg)) != ".json" { - fatalIf(errDummy().Trace(), - "Unrecognized policy file format `"+string(secondArg)+"`. Only json files are accepted.") - } - case "get", "get-json": // get or get-json always expects two arguments if argsLength != 2 {