{"action":"created","issue":{"url":"https://api.github.com/repos/eBay/jsonpipe/issues/1","labels_url":"https://api.github.com/repos/eBay/jsonpipe/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/eBay/jsonpipe/issues/1/comments","events_url":"https://api.github.com/repos/eBay/jsonpipe/issues/1/events","html_url":"https://github.com/eBay/jsonpipe/issues/1","id":105964759,"number":1,"title":"Asynchronous loading doesn't work in Safari","user":{"login":"m-koester","id":14231677,"avatar_url":"https://avatars.githubusercontent.com/u/14231677?v=3","gravatar_id":"","url":"https://api.github.com/users/m-koester","html_url":"https://github.com/m-koester","followers_url":"https://api.github.com/users/m-koester/followers","following_url":"https://api.github.com/users/m-koester/following{/other_user}","gists_url":"https://api.github.com/users/m-koester/gists{/gist_id}","starred_url":"https://api.github.com/users/m-koester/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m-koester/subscriptions","organizations_url":"https://api.github.com/users/m-koester/orgs","repos_url":"https://api.github.com/users/m-koester/repos","events_url":"https://api.github.com/users/m-koester/events{/privacy}","received_events_url":"https://api.github.com/users/m-koester/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-11T08:20:18Z","updated_at":"2015-09-11T08:43:47Z","closed_at":null,"body":"When I use jsonpipe on Mac OS X (Version 8.0.7 (10600.7.12)), the success callback is only called when the whole response was received. The problem is that in Safari the 'Transfer-Encoding' header is set to 'Identity' and this prevents jsonpipe to recognize the response as chunked. I already developed a patch and will try to attach it to this issue.\r\n"},"comment":{"url":"https://api.github.com/repos/eBay/jsonpipe/issues/comments/139488195","html_url":"https://github.com/eBay/jsonpipe/issues/1#issuecomment-139488195","issue_url":"https://api.github.com/repos/eBay/jsonpipe/issues/1","id":139488195,"user":{"login":"m-koester","id":14231677,"avatar_url":"https://avatars.githubusercontent.com/u/14231677?v=3","gravatar_id":"","url":"https://api.github.com/users/m-koester","html_url":"https://github.com/m-koester","followers_url":"https://api.github.com/users/m-koester/followers","following_url":"https://api.github.com/users/m-koester/following{/other_user}","gists_url":"https://api.github.com/users/m-koester/gists{/gist_id}","starred_url":"https://api.github.com/users/m-koester/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m-koester/subscriptions","organizations_url":"https://api.github.com/users/m-koester/orgs","repos_url":"https://api.github.com/users/m-koester/repos","events_url":"https://api.github.com/users/m-koester/events{/privacy}","received_events_url":"https://api.github.com/users/m-koester/received_events","type":"User","site_admin":false},"created_at":"2015-09-11T08:43:47Z","updated_at":"2015-09-11T08:43:47Z","body":"Here is my patch which fixes the problem in Safari:\r\n\r\nFrom 05e1699c91b8659b064fc9ee7208331a57112ea1 Mon Sep 17 00:00:00 2001\r\nFrom: \"m.koester\" <m.koester m.koester@binaere-bauten.de>\r\nDate: Fri, 11 Sep 2015 10:28:03 +0200\r\nSubject: [PATCH] Fixed transfer encoding detection in Safari\r\n\r\n---\r\n jsonpipe.js | 6 ++++--\r\n 1 file changed, 4 insertions(+), 2 deletions(-)\r\n\r\ndiff --git a/jsonpipe.js b/jsonpipe.js\r\nindex 969820d..1edc5dd 100644\r\n--- a/jsonpipe.js\r\n+++ b/jsonpipe.js\r\n@@ -131,7 +131,9 @@ function send(url, options) {\r\n             chromeSpdy;\r\n         if (xhr.readyState === state.HEADERS_RECEIVED) {\r\n             encoding = xhr.getResponseHeader('Transfer-Encoding') || '';\r\n-            isChunked = encoding.toLowerCase().indexOf('chunked') > -1;\r\n+            encoding = encoding.toLowerCase();\r\n+            isChunked = encoding.indexOf('chunked') > -1\r\n+                || encoding.indexOf('identity') > -1; // fix for Safari\r\n             if (!isChunked) {\r\n                 // SPDY inherently uses chunked transfer and does not define a header.\r\n                 // Firefox provides a synthetic header which can be used instead.\r\n@@ -195,4 +197,4 @@ module.exports = {\r\n };\r\n },{}]},{},[1])\r\n (1)\r\n-});\r\n\\ No newline at end of file\r\n+});\r\n-- \r\n2.3.2 (Apple Git-55)\r\n\r\n"}}