Fix REST API calls for projects with '/' in the name
Change-Id: I8b2cc7c26d2334219bfd1708c9a5cd88a1e4c497
diff --git a/src/main/resources/static/gr-reviewers-by-blame-config.js b/src/main/resources/static/gr-reviewers-by-blame-config.js
index ec8b1bd..d64b316 100644
--- a/src/main/resources/static/gr-reviewers-by-blame-config.js
+++ b/src/main/resources/static/gr-reviewers-by-blame-config.js
@@ -38,7 +38,7 @@
},
_getPreferences() {
- return this._projectRestApi.get(`${this.repoName}/config`)
+ return this._projectRestApi.get(`${encodeURIComponent(this.repoName)}/config`)
.then(config => {
if (!config) {
return;
@@ -59,7 +59,7 @@
let body = { plugin_config_values: {} };
body.plugin_config_values['reviewers-by-blame'] = this._changedConfig;
- this._projectRestApi.put(`${this.repoName}/config`, body)
+ this._projectRestApi.put(`${encodeURIComponent(this.repoName)}/config`, body)
.then(() => {
this._prefsChanged = false;
}).catch(response => {