File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
packages/middleware-apply-body-checksum/src Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ export const applyMd5BodyChecksumMiddleware =
17
17
( options : Md5BodyChecksumResolvedConfig ) : BuildMiddleware < any , any > =>
18
18
< Output extends MetadataBearer > ( next : BuildHandler < any , Output > ) : BuildHandler < any , Output > =>
19
19
async ( args : BuildHandlerArguments < any > ) : Promise < BuildHandlerOutput < Output > > => {
20
- let { request } = args ;
20
+ const { request } = args ;
21
21
if ( HttpRequest . isInstance ( request ) ) {
22
22
const { body, headers } = request ;
23
23
if ( ! hasHeader ( "content-md5" , headers ) ) {
@@ -30,18 +30,18 @@ export const applyMd5BodyChecksumMiddleware =
30
30
digest = options . streamHasher ( options . md5 , body ) ;
31
31
}
32
32
33
- const cloned = request . clone ( ) ;
33
+ const cloned = HttpRequest . clone ( request ) ;
34
34
cloned . headers = {
35
35
...headers ,
36
36
"content-md5" : options . base64Encoder ( await digest ) ,
37
37
} ;
38
- request = cloned ;
38
+ return next ( {
39
+ ...args ,
40
+ request : cloned ,
41
+ } ) ;
39
42
}
40
43
}
41
- return next ( {
42
- ...args ,
43
- request,
44
- } ) ;
44
+ return next ( args ) ;
45
45
} ;
46
46
47
47
export const applyMd5BodyChecksumMiddlewareOptions : BuildHandlerOptions = {
You can’t perform that action at this time.
0 commit comments