{"action":"created","issue":{"url":"https://api.github.com/repos/ariya/phantomjs/issues/13338","labels_url":"https://api.github.com/repos/ariya/phantomjs/issues/13338/labels{/name}","comments_url":"https://api.github.com/repos/ariya/phantomjs/issues/13338/comments","events_url":"https://api.github.com/repos/ariya/phantomjs/issues/13338/events","html_url":"https://github.com/ariya/phantomjs/pull/13338","id":89311675,"number":13338,"title":"[WIP] test: failing test for binary body","user":{"login":"LinusU","id":189580,"avatar_url":"https://avatars.githubusercontent.com/u/189580?v=3","gravatar_id":"","url":"https://api.github.com/users/LinusU","html_url":"https://github.com/LinusU","followers_url":"https://api.github.com/users/LinusU/followers","following_url":"https://api.github.com/users/LinusU/following{/other_user}","gists_url":"https://api.github.com/users/LinusU/gists{/gist_id}","starred_url":"https://api.github.com/users/LinusU/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LinusU/subscriptions","organizations_url":"https://api.github.com/users/LinusU/orgs","repos_url":"https://api.github.com/users/LinusU/repos","events_url":"https://api.github.com/users/LinusU/events{/privacy}","received_events_url":"https://api.github.com/users/LinusU/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-18T14:41:46Z","updated_at":"2015-12-21T22:47:22Z","closed_at":"2015-12-21T22:44:45Z","pull_request":{"url":"https://api.github.com/repos/ariya/phantomjs/pulls/13338","html_url":"https://github.com/ariya/phantomjs/pull/13338","diff_url":"https://github.com/ariya/phantomjs/pull/13338.diff","patch_url":"https://github.com/ariya/phantomjs/pull/13338.patch"},"body":"*This is more of a bug report than a pull request but I wanted to include a ready to go test case.*\r\n\r\nCurrently `body` is returned as a string to the javascript which can mess upp binary files. I think that the correct approach is to pass it as `Uint8ClampedArray` and then let the user do whatever it wants with it.\r\n\r\nI think that one of the main use case of this feature is to download files from a remote server and these files will in many cases be binary.\r\n\r\nIt seems like if we just keep the body as a `QByteArray` it should be mapped automatically.\r\n\r\n> It turned out that in Qt webkit 5.x QByteArray is mapped to Uint8ClampedArray and vise versa when passing through Qt webkit bridge.\r\n\r\n[source](http://www.qtcentre.org/archive/index.php/t-58892.html)"},"comment":{"url":"https://api.github.com/repos/ariya/phantomjs/issues/comments/166445032","html_url":"https://github.com/ariya/phantomjs/pull/13338#issuecomment-166445032","issue_url":"https://api.github.com/repos/ariya/phantomjs/issues/13338","id":166445032,"user":{"login":"LinusU","id":189580,"avatar_url":"https://avatars.githubusercontent.com/u/189580?v=3","gravatar_id":"","url":"https://api.github.com/users/LinusU","html_url":"https://github.com/LinusU","followers_url":"https://api.github.com/users/LinusU/followers","following_url":"https://api.github.com/users/LinusU/following{/other_user}","gists_url":"https://api.github.com/users/LinusU/gists{/gist_id}","starred_url":"https://api.github.com/users/LinusU/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LinusU/subscriptions","organizations_url":"https://api.github.com/users/LinusU/orgs","repos_url":"https://api.github.com/users/LinusU/repos","events_url":"https://api.github.com/users/LinusU/events{/privacy}","received_events_url":"https://api.github.com/users/LinusU/received_events","type":"User","site_admin":false},"created_at":"2015-12-21T22:47:22Z","updated_at":"2015-12-21T22:47:22Z","body":"I'll try and update this when I get time :)"}}