Encode query uri component properly

Previously we used encodeURI() to encode a single component of a URI,
this meant that characters like = were not encoded. This isn't correct
bceause we are just encoding a single component and need = to be
encoded. Fix this by using encodeURIComponent which should do the right
thing.

Change-Id: Ib320c1e646ccbd2233bd9d7a2be9df29ff7bd1ed
This commit is contained in:
Clark Boylan 2015-12-15 09:50:36 -08:00
parent 47f7ddf78f
commit df57bd6f9e
1 changed files with 1 additions and 1 deletions

View File

@ -58,7 +58,7 @@ function (angular, _) {
id : "urllink",
// Note that we hvae to do the encode json thing because kibana
// wants the parameters to be json quoted then url quoted ... :(
link : window.location.href.replace(window.location.hash,"")+"#dashboard/file/logstash.json?query="+encodeURI(JSON.stringify(dashboard.current.services.query.list[0].query).slice(1,-1)),
link : window.location.href.replace(window.location.hash,"")+"#dashboard/file/logstash.json?query="+encodeURIComponent(JSON.stringify(dashboard.current.services.query.list[0].query).slice(1,-1)),
title : "Share URL"
};
return;