Skip to content

Commit

Permalink
fixed sigV4 error
Browse files Browse the repository at this point in the history
  • Loading branch information
=Zachary Merritt committed Jan 25, 2022
1 parent efc9ea5 commit b4922cb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/src/request.dart
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ class AwsHttpRequest {

// generate canonical request, auth, and headers
final String canonicalRequest = getCanonicalRequest(
type: type.toString().split('.').last,
type: type.toString().toUpperCase().split('.').last,
requestBody: jsonBody,
signedHeaders: signedHeadersMap,
canonicalUri: canonicalUri,
Expand Down
8 changes: 4 additions & 4 deletions test/request_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,15 @@ void main() {
group('getCanonicalRequest', () {
test('getCanonicalRequest - 1', () {
final String requestString = AwsHttpRequest.getCanonicalRequest(
type: 'type',
type: AwsRequestType.post.toString().toUpperCase().split('.').last,
requestBody: 'requestBody',
signedHeaders: {'signedHeaderKey': 'signedHeaderValue'},
canonicalUri: 'canonical/Uri',
canonicalQuerystring: 'canonicalQuerystring=canonicalQuerystring',
);
expect(
'''
type
POST
canonical/Uri
canonicalQuerystring=canonicalQuerystring
signedHeaderKey:signedHeaderValue
Expand All @@ -148,7 +148,7 @@ fcf523fac03a2e3a814b7f97bf8c9533d657677c72ff3870afd69cef3b559c60''',
});
test('getCanonicalRequest - 2', () {
final String requestString = AwsHttpRequest.getCanonicalRequest(
type: 'type',
type: AwsRequestType.delete.toString().toUpperCase().split('.').last,
requestBody: '',
signedHeaders: {
'signedHeaderKey': 'signedHeaderValue',
Expand All @@ -160,7 +160,7 @@ fcf523fac03a2e3a814b7f97bf8c9533d657677c72ff3870afd69cef3b559c60''',
);
expect(
'''
type
DELETE
canonical/Uri
/
signedHeaderKey1:signedHeaderValue1
Expand Down

0 comments on commit b4922cb

Please sign in to comment.