Skip to content

Commit 303cb71

Browse files
chihuahuajart
authored andcommitted
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 24d3eea commit 303cb71

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

tensorboard/plugins/audio/tf_audio_dashboard/tf-audio-loader.html

Lines changed: 3 additions & 3 deletions
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;

tensorboard/plugins/image/tf_image_dashboard/tf-image-loader.html

Lines changed: 3 additions & 3 deletions
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;

0 commit comments

Comments
 (0)