Skip to content

Commit

Permalink
[Release 0.2.1]
Browse files Browse the repository at this point in the history
* Fixed issue with rejected headers on web
  • Loading branch information
=Zachary Merritt committed Jan 9, 2022
1 parent b876f57 commit 5000856
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 26 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [0.2.1] - 2022/01/08

* Fixed issue with rejected headers on web

## [0.2.0+1] - 2021/09/17

* Updated package description
Expand Down
26 changes: 1 addition & 25 deletions lib/aws_request.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,7 @@ class AwsRequest {
/// The timeout on the request
Duration timeout;
static const Map<String, String> _defaultHeaders = {
'User-Agent': 'Dart (dart:io)',
'Accept-Encoding': 'gzip, deflate',
'Accept': '*/*',
'Connection': 'keep-alive',
'Content-Type': 'application/x-amz-json-1.1',
};

Expand Down Expand Up @@ -226,35 +223,14 @@ class AwsRequest {
String auth,
) {
return {
'User-Agent': 'Dart (dart:io)',
'Accept-Encoding': 'gzip, deflate',
'Accept': '*/*',
'Connection': 'keep-alive',
'Keep-Alive':
'timeout=${timeout.inSeconds > 0 ? timeout.inSeconds : 1}, max=1000',
'Content-Type': 'application/x-amz-json-1.1',
..._defaultHeaders,
'Authorization': auth,
'X-Amz-Date': amzDate,
'x-amz-target': target,
'host': host,
'content-length': utf8.encode(requestBody).length.toString(),
...headers
};
}

String _constructUrl(
String host,
String canonicalUri,
Map<String, dynamic> canonicalQuerystring,
) {
return Uri(
scheme: 'https',
host: host,
path: canonicalUri,
queryParameters: canonicalQuerystring,
).toString();
}

Map<String, dynamic> _validateRequest(
String? service,
String? target,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: aws_request
description: Easily create, sign, and send API requests to AWS services without the hassle of implimenting Signature Version 4.
version: 0.2.0+1
version: 0.2.1
homepage: https://github.com/Zsmerritt/Flutter_AWS_Request

environment:
Expand Down

0 comments on commit 5000856

Please sign in to comment.