Skip to content

Commit 0f23598

Browse files
authored
Encode run and tag names (#480)
This change encodes the names of runs and tags included within the GET parameters of URIs for the audio, image, and pr_curve plugins. We pass those run and tag names into encodeURIComponent. Fixes #477. I verified that the audio, image, and PR curve plugins WAI.
1 parent 3b246c7 commit 0f23598

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Diff for: tensorboard/plugins/audio/tf_audio_dashboard/tf-audio-loader.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,9 @@
211211
}
212212
this._metadataCanceller.cancelAll();
213213
const router = getRouter();
214-
const baseURL = router.pluginRoute("audio", "/audio");
215-
const query = `run=${this.run}&tag=${this.tag}&sample=${this.sample}`;
216-
const url = baseURL + (baseURL.indexOf('?') !== -1 ? '&' : '?') + query;
214+
const route = router.pluginRunTagRoute("audio", "/audio")(
215+
this.tag, this.run);
216+
const url = `${route}&sample=${this.sample}`;
217217
const updateSteps = this._metadataCanceller.cancellable(result => {
218218
if (result.cancelled) {
219219
return;

Diff for: tensorboard/plugins/image/tf_image_dashboard/tf-image-loader.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,9 @@
306306
}
307307
this._metadataCanceller.cancelAll();
308308
const router = getRouter();
309-
const baseURL = router.pluginRoute("images", "/images");
310-
const query = `run=${this.run}&tag=${this.tag}&sample=${this.sample}`;
311-
const url = baseURL + (baseURL.indexOf('?') !== -1 ? '&' : '?') + query;
309+
const route = router.pluginRunTagRoute("images", "/images")(
310+
this.tag, this.run);
311+
const url = `${route}&sample=${this.sample}`;
312312
const updateSteps = this._metadataCanceller.cancellable(result => {
313313
if (result.cancelled) {
314314
return;

Diff for: tensorboard/plugins/pr_curve/tf_pr_curve_dashboard/tf-pr-curve-card.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,8 @@
295295

296296
let url = router.pluginRoute('pr_curves', '/pr_curves');
297297
url += url.indexOf('?') > -1 ? '&' : '?';
298-
url += `tag=${this.tag}`;
299-
url += this.runs.map(r => `&run=${r}`).join('');
298+
url += `tag=${encodeURIComponent(this.tag)}`;
299+
url += this.runs.map(r => `&run=${encodeURIComponent(r)}`).join('');
300300

301301
const updateData = this._canceller.cancellable(result => {
302302
if (result.cancelled) {

0 commit comments

Comments
 (0)