Skip to content

Commit

Permalink
Merge pull request #185 from particle-iot/fix/omit-empty-querystring
Browse files Browse the repository at this point in the history
Don't add an empty query string to the URL
  • Loading branch information
monkbroc authored Jun 21, 2024
2 parents 25e5c4e + 4c5f691 commit 70275e1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,10 @@ class Agent {
}
if (query) {
const queryParams = qs.stringify(query);
const hasParams = actualUri.includes('?');
actualUri = `${actualUri}${hasParams ? '&' : '?'}${queryParams}`;
if (queryParams) {
const hasParams = actualUri.includes('?');
actualUri = `${actualUri}${hasParams ? '&' : '?'}${queryParams}`;
}
}

const userAgentHeader = { 'User-Agent': `${packageJson.name}/${packageJson.version} (${packageJson.repository.url})` };
Expand Down

0 comments on commit 70275e1

Please sign in to comment.