Skip to content

Commit 5000856

Browse files
author
=Zachary Merritt
committed
[Release 0.2.1]
* Fixed issue with rejected headers on web
1 parent b876f57 commit 5000856

File tree

3 files changed

+6
-26
lines changed

3 files changed

+6
-26
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [0.2.1] - 2022/01/08
2+
3+
* Fixed issue with rejected headers on web
4+
15
## [0.2.0+1] - 2021/09/17
26

37
* Updated package description

lib/aws_request.dart

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,7 @@ class AwsRequest {
5555
/// The timeout on the request
5656
Duration timeout;
5757
static const Map<String, String> _defaultHeaders = {
58-
'User-Agent': 'Dart (dart:io)',
59-
'Accept-Encoding': 'gzip, deflate',
6058
'Accept': '*/*',
61-
'Connection': 'keep-alive',
6259
'Content-Type': 'application/x-amz-json-1.1',
6360
};
6461

@@ -226,35 +223,14 @@ class AwsRequest {
226223
String auth,
227224
) {
228225
return {
229-
'User-Agent': 'Dart (dart:io)',
230-
'Accept-Encoding': 'gzip, deflate',
231-
'Accept': '*/*',
232-
'Connection': 'keep-alive',
233-
'Keep-Alive':
234-
'timeout=${timeout.inSeconds > 0 ? timeout.inSeconds : 1}, max=1000',
235-
'Content-Type': 'application/x-amz-json-1.1',
226+
..._defaultHeaders,
236227
'Authorization': auth,
237228
'X-Amz-Date': amzDate,
238229
'x-amz-target': target,
239-
'host': host,
240-
'content-length': utf8.encode(requestBody).length.toString(),
241230
...headers
242231
};
243232
}
244233

245-
String _constructUrl(
246-
String host,
247-
String canonicalUri,
248-
Map<String, dynamic> canonicalQuerystring,
249-
) {
250-
return Uri(
251-
scheme: 'https',
252-
host: host,
253-
path: canonicalUri,
254-
queryParameters: canonicalQuerystring,
255-
).toString();
256-
}
257-
258234
Map<String, dynamic> _validateRequest(
259235
String? service,
260236
String? target,

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: aws_request
22
description: Easily create, sign, and send API requests to AWS services without the hassle of implimenting Signature Version 4.
3-
version: 0.2.0+1
3+
version: 0.2.1
44
homepage: https://github.com/Zsmerritt/Flutter_AWS_Request
55

66
environment:

0 commit comments

Comments
 (0)