-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: update to aws-sdk 3.4.1 #7726
Changes from all commits
70f15aa
2f4150c
d9d6c45
86db32a
5df6112
9cbf6b9
6e44f5a
0d645fa
ddf1f6d
2a155a6
c4b4caf
abe342e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ | |
}, | ||
{ | ||
"path": "dist/Amplify+Auth.js.min.js", | ||
"maxSize": "200kB" | ||
"maxSize": "215kB" | ||
} | ||
] | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,6 @@ import { | |
} from '@aws-sdk/client-s3'; | ||
import { AxiosHttpHandler, SEND_PROGRESS_EVENT } from './axios-http-handler'; | ||
import * as events from 'events'; | ||
import { parseUrl } from '@aws-sdk/url-parser-node'; | ||
import { streamCollector } from '@aws-sdk/fetch-http-handler'; | ||
|
||
const logger = new Logger('AWSS3ProviderManagedUpload'); | ||
|
@@ -140,6 +139,27 @@ export class AWSS3ProviderManagedUpload { | |
this.params | ||
); | ||
const s3 = await this._createNewS3Client(this.opts); | ||
|
||
// @aws-sdk/client-s3 seems to be ignoring the `ContentType` parameter, so we | ||
// are explicitly adding it via middleware. | ||
// https://github.com/aws/aws-sdk-js-v3/issues/2000 | ||
s3.middlewareStack.add( | ||
next => (args: any) => { | ||
if ( | ||
this.params.ContentType && | ||
args && | ||
args.request && | ||
args.request.headers | ||
) { | ||
args.request.headers['Content-Type'] = this.params.ContentType; | ||
} | ||
return next(args); | ||
}, | ||
{ | ||
step: 'build', | ||
} | ||
); | ||
Comment on lines
+143
to
+161
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Comment is pretty self explanatory, but there appears to be an issue with the SDK where it is removing We now have multiple tests in CircleCI for React & React Native (iOS & Android) to validate multi-part uploads. |
||
|
||
const response = await s3.send(createMultiPartUploadCommand); | ||
logger.debug(response.UploadId); | ||
return response.UploadId; | ||
|
@@ -350,7 +370,6 @@ export class AWSS3ProviderManagedUpload { | |
...localTestingConfig, | ||
requestHandler: new AxiosHttpHandler({}, emitter), | ||
customUserAgent: getAmplifyUserAgent(), | ||
urlParser: parseUrl, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Per conversation with SDK team, there is no need to explicitly pass This was removed because |
||
}); | ||
client.middlewareStack.remove(SET_CONTENT_LENGTH_HEADER); | ||
return client; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,14 +16,14 @@ import { HttpHandler, HttpRequest, HttpResponse } from '@aws-sdk/protocol-http'; | |
import { buildQueryString } from '@aws-sdk/querystring-builder'; | ||
import axios, { AxiosRequestConfig, Method } from 'axios'; | ||
import { ConsoleLogger as Logger } from '@aws-amplify/core'; | ||
import { BrowserHttpOptions } from '@aws-sdk/fetch-http-handler'; | ||
import { FetchHttpHandlerOptions } from '@aws-sdk/fetch-http-handler'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was renamed in rc.8: aws/aws-sdk-js-v3#1697 |
||
|
||
const logger = new Logger('axios-http-handler'); | ||
export const SEND_PROGRESS_EVENT = 'sendProgress'; | ||
|
||
export class AxiosHttpHandler implements HttpHandler { | ||
constructor( | ||
private readonly httpOptions: BrowserHttpOptions = {}, | ||
private readonly httpOptions: FetchHttpHandlerOptions = {}, | ||
private readonly emitter?: any | ||
) {} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to import from
@aws-sdk/client-pinpoint/models
since it is exported from the root: https://github.com/aws/aws-sdk-js-v3/blob/master/clients/client-pinpoint/index.ts#L115