You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ji...@apache.org on 2020/12/01 06:39:13 UTC

[incubator-pinot] branch master updated: [TE] frontend harleyjj/rca - double encode filter value to protect against special characters (#6281)

This is an automated email from the ASF dual-hosted git repository.

jihao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new 5b0d1df  [TE] frontend harleyjj/rca - double encode filter value to protect against special characters (#6281)
5b0d1df is described below

commit 5b0d1df2563b2ad77d5ea0e8c2418c889769a989
Author: Harley Jackson <hj...@linkedin.com>
AuthorDate: Mon Nov 30 22:38:55 2020 -0800

    [TE] frontend harleyjj/rca - double encode filter value to protect against special characters (#6281)
---
 thirdeye/thirdeye-frontend/app/utils/rca-utils.js | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/thirdeye/thirdeye-frontend/app/utils/rca-utils.js b/thirdeye/thirdeye-frontend/app/utils/rca-utils.js
index 622d144..1a491c5 100644
--- a/thirdeye/thirdeye-frontend/app/utils/rca-utils.js
+++ b/thirdeye/thirdeye-frontend/app/utils/rca-utils.js
@@ -184,11 +184,15 @@ export function appendTail(urn, tail) {
  * @see appendTail(urn, tail)
  *
  * @param {string} urn entity urn
- * @param {Array} filters array of filter tuples [key, value]
+ * @param {Array} filters array of strings ["key", "=", "value"]
  * @returns {string} merged metric urn
  */
 export function appendFilters(urn, filters) {
-  const tail = filters.map(t => encodeURIComponent(`${t[0]}${t[1]}${t[2]}`));
+  const tail = filters.map(t => {
+    // protects against special characters being in value string
+    const encodedValue = encodeURIComponent(t[2]);
+    return encodeURIComponent(`${t[0]}${t[1]}${encodedValue}`);
+  });
   return appendTail(urn, tail);
 }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org