mirror of
https://github.com/versity/versitygw.git
synced 2026-01-08 12:41:10 +00:00
fix: Fixes the bucket policy json document validation errors for invalid jsons.
Fixes #965 Changes the returned error description to `Policies must be valid JSON and the first byte must be '{'` for invalid bucket policy json documents, which doesn't start with `{`. The gateway returns `This policy contains invalid Json` error description, if the document starts with `{`, but still isn't valid json. Implements the `policyErr` string type which implements the `error` interface, to handle the policy json document validation errors, by avoiding staticchecker warnings.
This commit is contained in:
@@ -634,8 +634,7 @@ func TestS3ApiController_PutBucketActions(t *testing.T) {
|
||||
</VersioningConfiguration>
|
||||
`
|
||||
|
||||
policyBody := `
|
||||
{
|
||||
policyBody := `{
|
||||
"Statement": [
|
||||
{
|
||||
"Effect": "Allow",
|
||||
|
||||
Reference in New Issue
Block a user