From 339f1642451941db07bd51418bd8c5c2e2de8f48 Mon Sep 17 00:00:00 2001 From: nscuro Date: Thu, 10 Oct 2024 19:35:45 +0200 Subject: [PATCH] Fix missing URI encoding of tag names The *tagged projects*, *tagged policies*, and *tagged alerts* dialogs would show an empty list for tags that contain special characters such as `/`. This was caused by both https://github.com/DependencyTrack/dependency-track/issues/4238, and tag names not being URI-encoded prior to using them as path parameters. Signed-off-by: nscuro --- src/views/portfolio/tags/TagList.vue | 1 - src/views/portfolio/tags/TaggedNotificationRuleListModal.vue | 2 +- src/views/portfolio/tags/TaggedPoliciesListModal.vue | 2 +- src/views/portfolio/tags/TaggedProjectListModal.vue | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/views/portfolio/tags/TagList.vue b/src/views/portfolio/tags/TagList.vue index 23d2ac3cf..0593e0a23 100644 --- a/src/views/portfolio/tags/TagList.vue +++ b/src/views/portfolio/tags/TagList.vue @@ -81,7 +81,6 @@ export default { template: `
{{ value }} -
`, data() { diff --git a/src/views/portfolio/tags/TaggedNotificationRuleListModal.vue b/src/views/portfolio/tags/TaggedNotificationRuleListModal.vue index 307469421..dbc944555 100644 --- a/src/views/portfolio/tags/TaggedNotificationRuleListModal.vue +++ b/src/views/portfolio/tags/TaggedNotificationRuleListModal.vue @@ -35,7 +35,7 @@ export default { mixins: [permissionsMixin], methods: { apiUrl: function () { - return `${this.$api.BASE_URL}/${this.$api.URL_TAG}/${this.tag}/notificationRule`; + return `${this.$api.BASE_URL}/${this.$api.URL_TAG}/${encodeURIComponent(this.tag)}/notificationRule`; }, untag: function (notificationRuleUuids) { return this.axios.delete(this.apiUrl(), { diff --git a/src/views/portfolio/tags/TaggedPoliciesListModal.vue b/src/views/portfolio/tags/TaggedPoliciesListModal.vue index ec71a4210..bb11d45b5 100644 --- a/src/views/portfolio/tags/TaggedPoliciesListModal.vue +++ b/src/views/portfolio/tags/TaggedPoliciesListModal.vue @@ -35,7 +35,7 @@ export default { mixins: [permissionsMixin], methods: { apiUrl: function () { - return `${this.$api.BASE_URL}/${this.$api.URL_TAG}/${this.tag}/policy`; + return `${this.$api.BASE_URL}/${this.$api.URL_TAG}/${encodeURIComponent(this.tag)}/policy`; }, untag: function (policyUuids) { return this.axios.delete(this.apiUrl(), { diff --git a/src/views/portfolio/tags/TaggedProjectListModal.vue b/src/views/portfolio/tags/TaggedProjectListModal.vue index ab0537dc2..3be1ff7c0 100644 --- a/src/views/portfolio/tags/TaggedProjectListModal.vue +++ b/src/views/portfolio/tags/TaggedProjectListModal.vue @@ -37,7 +37,7 @@ export default { mixins: [bootstrapTableMixin, permissionsMixin], methods: { apiUrl: function () { - return `${this.$api.BASE_URL}/${this.$api.URL_TAG}/${this.tag}/project`; + return `${this.$api.BASE_URL}/${this.$api.URL_TAG}/${encodeURIComponent(this.tag)}/project`; }, untag: function (projectUuids) { return this.axios.delete(this.apiUrl(), {