Skip to content

Commit d3869f0

Browse files
MytsVmaany
authored andcommitted
URI encode request parameters in the SDK
1 parent 4f28f46 commit d3869f0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/lib/sdk/http.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ export function prepareRequestArgs(request: HTTPRequest): {
2525
} {
2626
if (request.params) {
2727
const url = new URL(request.url);
28-
Object.keys(request.params).forEach(key => url.searchParams.append(key, request.params![key]));
28+
Object.keys(request.params).forEach(key => {
29+
const encodedValue = encodeURIComponent(request.params![key]);
30+
url.searchParams.append(key, encodedValue);
31+
});
2932
request.url = url.toString();
3033
}
3134
const requestArgs: RequestInit = {

0 commit comments

Comments
 (0)