{"action":"created","issue":{"url":"https://api.github.com/repos/fgnass/tamper/issues/2","labels_url":"https://api.github.com/repos/fgnass/tamper/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/fgnass/tamper/issues/2/comments","events_url":"https://api.github.com/repos/fgnass/tamper/issues/2/events","html_url":"https://github.com/fgnass/tamper/issues/2","id":107136460,"number":2,"title":"Encoding problem","user":{"login":"huzhiren","id":1142612,"avatar_url":"https://avatars.githubusercontent.com/u/1142612?v=3","gravatar_id":"","url":"https://api.github.com/users/huzhiren","html_url":"https://github.com/huzhiren","followers_url":"https://api.github.com/users/huzhiren/followers","following_url":"https://api.github.com/users/huzhiren/following{/other_user}","gists_url":"https://api.github.com/users/huzhiren/gists{/gist_id}","starred_url":"https://api.github.com/users/huzhiren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huzhiren/subscriptions","organizations_url":"https://api.github.com/users/huzhiren/orgs","repos_url":"https://api.github.com/users/huzhiren/repos","events_url":"https://api.github.com/users/huzhiren/events{/privacy}","received_events_url":"https://api.github.com/users/huzhiren/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-18T05:28:46Z","updated_at":"2015-11-08T07:55:48Z","closed_at":"2015-11-08T07:55:48Z","body":"When I use tamper to wrap a response from another server:\r\n\r\nexports.wrap = tamper(function(req, res) {\r\n\r\n    // Return a function in order to capture and modify the response body: \r\n    return function(body) {\r\n\t\tvar result = (body.indexOf('resultCode')<0)? ('{\"result\":{\"resultCode\":1,\"message\":\"success\"},\"results\":'+body+'}') : body;\r\n\t\treturn result;\r\n    }\r\n});\r\n\r\nI got gibberish in body, any suggestion?"},"comment":{"url":"https://api.github.com/repos/fgnass/tamper/issues/comments/154788106","html_url":"https://github.com/fgnass/tamper/issues/2#issuecomment-154788106","issue_url":"https://api.github.com/repos/fgnass/tamper/issues/2","id":154788106,"user":{"login":"huzhiren","id":1142612,"avatar_url":"https://avatars.githubusercontent.com/u/1142612?v=3","gravatar_id":"","url":"https://api.github.com/users/huzhiren","html_url":"https://github.com/huzhiren","followers_url":"https://api.github.com/users/huzhiren/followers","following_url":"https://api.github.com/users/huzhiren/following{/other_user}","gists_url":"https://api.github.com/users/huzhiren/gists{/gist_id}","starred_url":"https://api.github.com/users/huzhiren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huzhiren/subscriptions","organizations_url":"https://api.github.com/users/huzhiren/orgs","repos_url":"https://api.github.com/users/huzhiren/repos","events_url":"https://api.github.com/users/huzhiren/events{/privacy}","received_events_url":"https://api.github.com/users/huzhiren/received_events","type":"User","site_admin":false},"created_at":"2015-11-08T07:55:48Z","updated_at":"2015-11-08T07:55:48Z","body":"Yes, it is the gzib compressed body issue, I finally use it only in the same server, only place it in the router middleware, and it work fine."}}