New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure segment value is decoded before sending in HTTP request through angular #8843

Merged
merged 1 commit into from Sep 23, 2015
Jump to file or symbol
Failed to load files and symbols.
+6 −1
Diff settings

Always

Just for now

Make sure segment value is decoded in piwik-api angular service befor…

…e sending again in an HTTP request via angular. Otherwise, the segment will be double encoded.
  • Loading branch information...
diosmosis committed Sep 23, 2015
commit 5e8a5c491e4ef234d5ba93a5a392e8033a6465d4
@@ -170,11 +170,16 @@
* @private
*/
function _mixinDefaultGetParams (getParamsToMixin) {
var segment = piwik.broadcast.getValueFromHash('segment', $window.location.href.split('#')[1]);
// we have to decode the value manually because broadcast will not decode anything itself. if we don't,
// angular will encode it again before sending the value in an HTTP request.
segment = decodeURIComponent(segment);
var defaultParams = {
idSite: piwik.idSite || piwik.broadcast.getValueFromUrl('idSite'),
period: piwik.period || piwik.broadcast.getValueFromUrl('period'),
segment: piwik.broadcast.getValueFromHash('segment', $window.location.href.split('#')[1])
segment: segment
};
// never append token_auth to url
ProTip! Use n and p to navigate between commits in a pull request.