Skip to content

Commit

Permalink
Merge pull request #161 from reinink/patch-1
Browse files Browse the repository at this point in the history
Only remove null and undefined query params
  • Loading branch information
DanielCoulbourne authored Jul 6, 2018
2 parents 32e97f8 + b1cf161 commit cf6dc47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class Router extends String {
let queryString = '?';

Object.keys(this.queryParams).forEach(function(key, i) {
if (this.queryParams[key]) {
if (this.queryParams[key] !== undefined && this.queryParams[key] !== null) {
queryString = i === 0 ? queryString : queryString + '&';
queryString += key + '=' + encodeURIComponent(this.queryParams[key]);
}
Expand Down

0 comments on commit cf6dc47

Please sign in to comment.