Prevent querystrings from starting with &

Fixes #1953
This commit is contained in:
David Kaltschmidt
2016-10-27 16:02:25 +02:00
parent 590f0078e7
commit 60037c8c7c
2 changed files with 19 additions and 2 deletions

View File

@@ -25,9 +25,9 @@ let controlErrorTimer = 0;
let createWebsocketAt = 0;
let firstMessageOnWebsocketAt = 0;
function buildOptionsQuery(options) {
export function buildOptionsQuery(options) {
if (options) {
return options.reduce((query, value, param) => `${query}&${param}=${value}`, '');
return options.map((value, param) => `${param}=${value}`).join('&');
}
return '';
}