Skip to content

Commit

Permalink
Safer buildQueryString (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnwiseheart authored and ferozco committed Jan 16, 2020
1 parent 5cf0f74 commit b382246
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions changelog/@unreleased/pr-94.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: fix
fix:
description: Check that queryArguments is non-null before iterating over keys
links:
- https://github.com/palantir/conjure-typescript-runtime/pull/94
4 changes: 4 additions & 0 deletions packages/conjure-client/src/fetchBridge/fetchBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ export class FetchBridge implements IHttpApiBridge {
}

private buildQueryString(data: { [key: string]: any }) {
if (data == null) {
return "";
}

const query: string[] = [];
for (const key of Object.keys(data)) {
const value = data[key];
Expand Down

0 comments on commit b382246

Please sign in to comment.