Skip to content

Commit a6a8711

Browse files
committed
Merge pull request #96 from jzaefferer/change-url-query-string-support
Server: Fix query string concatenation
2 parents 79f8acc + ec3c4fa commit a6a8711

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

lib/server.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,15 @@ exports.Server = function Server(bsClient, workers) {
160160
function checkAndTerminateWorker(worker, callback) {
161161
var next_path = getNextTestPath(worker);
162162
if (next_path) {
163-
var new_url = 'http://localhost:' + 8888 + '/' + next_path
164-
+ "?_worker_key=" + worker._worker_key + "&_browser_string=" + getTestBrowserInfo(worker) ;
163+
var url = 'http://localhost:' + 8888 + '/' + next_path;
164+
if (url.indexOf('?') > 0) {
165+
url += '&';
166+
} else {
167+
url += '?';
168+
}
169+
url += "_worker_key=" + worker._worker_key + "&_browser_string=" + getTestBrowserInfo(worker) ;
165170
worker.test_path = next_path;
166-
bsClient.changeUrl(worker.id, {url: new_url}, function() {
171+
bsClient.changeUrl(worker.id, {url: url}, function() {
167172
callback(true);
168173
});
169174
} else {

0 commit comments

Comments
 (0)