Escape builder names in url* and pathFor* methods of BuildbotSyncer
[WebKit-https.git] / Websites / perf.webkit.org / tools / js / buildbot-syncer.js
index 5d94ebd210706a71ed6dea416958b0728fe068b1..465ffba13566f519da7cb06c147d937f86b269ad 100644 (file)
@@ -44,7 +44,7 @@ class BuildbotBuildEntry {
             if (request.isPending())
                 return 'scheduled';
         } else if (this.isInProgress()) {
-            if (!request.hasStarted())
+            if (!request.hasStarted() || request.isScheduled())
                 return 'running';
         } else if (this.hasFinished()) {
             if (!request.hasFinished())
@@ -179,16 +179,16 @@ class BuildbotSyncer {
         });
     }
 
-    pathForPendingBuildsJSON() { return `/json/builders/${this._builderName}/pendingBuilds`; }
+    pathForPendingBuildsJSON() { return `/json/builders/${escape(this._builderName)}/pendingBuilds`; }
     pathForBuildJSON(selectedBuilds)
     {
-        return `/json/builders/${this._builderName}/builds/?`
+        return `/json/builders/${escape(this._builderName)}/builds/?`
             + selectedBuilds.map(function (number) { return 'select=' + number; }).join('&');
     }
-    pathForForceBuild() { return `/builders/${this._builderName}/force`; }
+    pathForForceBuild() { return `/builders/${escape(this._builderName)}/force`; }
 
-    url() { return this._remote.url(`/builders/${this._builderName}/`); }
-    urlForBuildNumber(number) { return this._remote.url(`/builders/${this._builderName}/builds/${number}`); }
+    url() { return this._remote.url(`/builders/${escape(this._builderName)}/`); }
+    urlForBuildNumber(number) { return this._remote.url(`/builders/${escape(this._builderName)}/builds/${number}`); }
 
     _propertiesForBuildRequest(buildRequest)
     {