Merge branch 'stable-2.16' into stable-3.0
* stable-2.16:
Fix REST API calls for projects with '/' in the name
Change-Id: Id28ebb69045fa7b02f01d36d640e81857e91f6cc
diff --git a/src/main/resources/static/gr-uploadvalidator-config.js b/src/main/resources/static/gr-uploadvalidator-config.js
index 508231c..be54c1d 100644
--- a/src/main/resources/static/gr-uploadvalidator-config.js
+++ b/src/main/resources/static/gr-uploadvalidator-config.js
@@ -42,7 +42,7 @@
},
_getPreferences() {
- return this._projectRestApi.get(`${this.repoName}/config`)
+ return this._projectRestApi.get(`${encodeURIComponent(this.repoName)}/config`)
.then(config => {
if (!config) {
return;
@@ -67,7 +67,7 @@
let body = { plugin_config_values: {} };
body.plugin_config_values.uploadvalidator = this._changedConfig;
- this._projectRestApi.put(`${this.repoName}/config`, body)
+ this._projectRestApi.put(`${encodeURIComponent(this.repoName)}/config`, body)
.then(() => {
this._prefsChanged = false;
}).catch(response => {