File tree 3 files changed +5
-7
lines changed
3 files changed +5
-7
lines changed Original file line number Diff line number Diff line change 1
1
import { QueryParameterBag } from "@aws-sdk/types" ;
2
- import { escapeUri , escapeUriPath } from "@aws-sdk/util-uri-escape" ;
2
+ import { escapeUri } from "@aws-sdk/util-uri-escape" ;
3
3
4
4
export function buildQueryString ( query : QueryParameterBag ) : string {
5
5
const parts : string [ ] = [ ] ;
Original file line number Diff line number Diff line change 21
21
"@aws-sdk/is-array-buffer" : " ^1.0.0-alpha.2" ,
22
22
"@aws-sdk/types" : " ^1.0.0-alpha.4" ,
23
23
"@aws-sdk/util-hex-encoding" : " ^1.0.0-alpha.2" ,
24
+ "@aws-sdk/util-uri-escape" : " ^1.0.0-alpha.2" ,
24
25
"tslib" : " ^1.8.0"
25
26
},
26
27
"devDependencies" : {
Original file line number Diff line number Diff line change 1
1
import { SIGNATURE_HEADER } from "./constants" ;
2
2
import { HttpRequest } from "@aws-sdk/types" ;
3
+ import { escapeUri } from "@aws-sdk/util-uri-escape" ;
3
4
4
5
/**
5
6
* @internal
@@ -15,18 +16,14 @@ export function getCanonicalQuery({ query = {} }: HttpRequest): string {
15
16
keys . push ( key ) ;
16
17
const value = query [ key ] ;
17
18
if ( typeof value === "string" ) {
18
- serialized [ key ] = `${ encodeURIComponent ( key ) } =${ encodeURIComponent (
19
- value
20
- ) } `;
19
+ serialized [ key ] = `${ escapeUri ( key ) } =${ escapeUri ( value ) } ` ;
21
20
} else if ( Array . isArray ( value ) ) {
22
21
serialized [ key ] = value
23
22
. slice ( 0 )
24
23
. sort ( )
25
24
. reduce (
26
25
( encoded : Array < string > , value : string ) =>
27
- encoded . concat ( [
28
- `${ encodeURIComponent ( key ) } =${ encodeURIComponent ( value ) } `
29
- ] ) ,
26
+ encoded . concat ( [ `${ escapeUri ( key ) } =${ escapeUri ( value ) } ` ] ) ,
30
27
[ ]
31
28
)
32
29
. join ( "&" ) ;
You can’t perform that action at this time.
0 commit comments