From 001cdfeb0538d39e18b6c40563b098de3ae968ce Mon Sep 17 00:00:00 2001 From: Christopher Rogers Date: Sat, 9 May 2015 08:04:11 -0700 Subject: [PATCH] Fixes double-decoding of event data - koa's [query getter](https://github.com/koajs/koa/blob/master/lib/request.js#L137) implements [querystring#parse](https://nodejs.org/api/querystring.html#querystring_querystring_parse_str_sep_eq_options), which already calls `decodeURIComponent` - if the data object passed contained a '%', the second decode here would fail. --- lib/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/index.js b/lib/index.js index e9ec9b6..6f3575e 100644 --- a/lib/index.js +++ b/lib/index.js @@ -437,10 +437,9 @@ DuoTest.prototype.send = function(){ DuoTest.prototype.event = function(){ var self = this; return function*(){ - var data = decodeURIComponent(this.query.data); var id = this.query.id; var b = self.browsers[id]; - var j = JSON.parse(data); + var j = JSON.parse(this.query.data); // edge-case if (!b) return;