Skip to content

Commit

Permalink
Merge pull request #74 from shinriyo/patch-6
Browse files Browse the repository at this point in the history
add not push
  • Loading branch information
lijy91 authored Sep 13, 2024
2 parents 38913da + 0260a58 commit 3c3c468
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/src/minio.dart
Original file line number Diff line number Diff line change
Expand Up @@ -816,22 +816,23 @@ class Minio {
postPolicy.setExpires(expires);
}

postPolicy.policy['conditions'].push(['eq', r'$x-amz-date', dateStr]);
postPolicy.policy['conditions'].add(['eq', r'$x-amz-date', dateStr]);
postPolicy.formData['x-amz-date'] = dateStr;

postPolicy.policy['conditions']
.push(['eq', r'$x-amz-algorithm', 'AWS4-HMAC-SHA256']);
.add(['eq', r'$x-amz-algorithm', 'AWS4-HMAC-SHA256']);
postPolicy.formData['x-amz-algorithm'] = 'AWS4-HMAC-SHA256';

postPolicy.policy['conditions'].push(
postPolicy.policy['conditions'].add(
['eq', r'$x-amz-credential', '$accessKey/${getScope(region, date)}'],
);

postPolicy.formData['x-amz-credential'] =
'$accessKey/${getScope(region, date)}';

if (sessionToken != null) {
postPolicy.policy['conditions']
.push(['eq', r'$x-amz-security-token', sessionToken]);
.add(['eq', r'$x-amz-security-token', sessionToken]);
}

final policyBase64 = jsonBase64(postPolicy.policy);
Expand Down

0 comments on commit 3c3c468

Please sign in to comment.