{"action":"created","issue":{"url":"https://api.github.com/repos/electron/electron/issues/8302","repository_url":"https://api.github.com/repos/electron/electron","labels_url":"https://api.github.com/repos/electron/electron/issues/8302/labels{/name}","comments_url":"https://api.github.com/repos/electron/electron/issues/8302/comments","events_url":"https://api.github.com/repos/electron/electron/issues/8302/events","html_url":"https://github.com/electron/electron/issues/8302","id":197963498,"number":8302,"title":"Large size http request been cut off when through protocol registerHttpProtocol API","user":{"login":"x-yao","id":5781441,"avatar_url":"https://avatars3.githubusercontent.com/u/5781441?v=4","gravatar_id":"","url":"https://api.github.com/users/x-yao","html_url":"https://github.com/x-yao","followers_url":"https://api.github.com/users/x-yao/followers","following_url":"https://api.github.com/users/x-yao/following{/other_user}","gists_url":"https://api.github.com/users/x-yao/gists{/gist_id}","starred_url":"https://api.github.com/users/x-yao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/x-yao/subscriptions","organizations_url":"https://api.github.com/users/x-yao/orgs","repos_url":"https://api.github.com/users/x-yao/repos","events_url":"https://api.github.com/users/x-yao/events{/privacy}","received_events_url":"https://api.github.com/users/x-yao/received_events","type":"User","site_admin":false},"labels":[{"id":520323169,"url":"https://api.github.com/repos/electron/electron/labels/bug%20:beetle:","name":"bug :beetle:","color":"7be1e5","default":false},{"id":227722189,"url":"https://api.github.com/repos/electron/electron/labels/component/protocol","name":"component/protocol","color":"f9d0c4","default":false},{"id":97403606,"url":"https://api.github.com/repos/electron/electron/labels/platform/macOS","name":"platform/macOS","color":"c7def8","default":false},{"id":538711450,"url":"https://api.github.com/repos/electron/electron/labels/version/1.4.x","name":"version/1.4.x","color":"bfdadc","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-29T07:06:24Z","updated_at":"2018-04-06T16:57:17Z","closed_at":"2018-04-06T16:57:17Z","author_association":"MEMBER","body":"<!--\r\nThanks for opening an issue! A few things to keep in mind:\r\n\r\n- The issue tracker is only for bugs and feature requests.\r\n- Before reporting a bug, please try reproducing your issue against\r\n  the latest version of Electron.\r\n- If you need general advice, join our Slack: http://atom-slack.herokuapp.com\r\n-->\r\n\r\n* Electron version:1.4.12\r\n* Operating system:macOS Sierra\r\n\r\n### Expected behavior\r\n\r\n<!-- What do you think should happen? -->\r\nWhen I Use registerHttpProtocol to watch http requests and let original request callback to the browser.Expected all request work find.\r\n\r\n\tprotocol.interceptHttpProtocol('http',(request, callback) => {\r\n\t\tlet postData;\r\n\t\tif (request.uploadData) {\r\n\t\t\tpostData = request.uploadData[0].bytes.toString();\r\n\t\t}\r\n\t\tlet par = {\r\n\t\t\turl:request.url,\r\n\t\t\tmethod:request.method\r\n\t\t}\r\n\t\tif (request.method == \"POST\") {\r\n\t\t\tpar.session = null;\r\n\t\t\tpar.uploadData = {\r\n\t\t\t\tcontentType:'text/html',\r\n\t\t\t\tdata: postData\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tpar.session = null\r\n\t\t}\r\n\t\tcallback(par)\r\n\t}, (error) => {\r\n\t\tif (error) console.error('Failed to register protocol')\r\n\t})\r\n\r\nExpected like this : \r\n![Expected](https://img.kuaidadi.com/cms/img/upload_c20a77380e92bf47faec9741cce856b9.png)\r\n\r\n### Actual behavior\r\nWhen request a large size file like huge non-compressed javascript(more than 40000 lines) it would be cut off through protocol registerHttpProtocol API and if use WebRequest API it would not be cut off.\r\n\r\nActual this : \r\n![Actual](https://img.kuaidadi.com/cms/img/upload_bf1698ffeeab55f1cfd4eced3f1d6a80.png)\r\n\r\n<!-- What actually happens? -->\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/electron/electron/issues/comments/379313488","html_url":"https://github.com/electron/electron/issues/8302#issuecomment-379313488","issue_url":"https://api.github.com/repos/electron/electron/issues/8302","id":379313488,"user":{"login":"sofianguy","id":2138661,"avatar_url":"https://avatars3.githubusercontent.com/u/2138661?v=4","gravatar_id":"","url":"https://api.github.com/users/sofianguy","html_url":"https://github.com/sofianguy","followers_url":"https://api.github.com/users/sofianguy/followers","following_url":"https://api.github.com/users/sofianguy/following{/other_user}","gists_url":"https://api.github.com/users/sofianguy/gists{/gist_id}","starred_url":"https://api.github.com/users/sofianguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sofianguy/subscriptions","organizations_url":"https://api.github.com/users/sofianguy/orgs","repos_url":"https://api.github.com/users/sofianguy/repos","events_url":"https://api.github.com/users/sofianguy/events{/privacy}","received_events_url":"https://api.github.com/users/sofianguy/received_events","type":"User","site_admin":false},"created_at":"2018-04-06T16:57:17Z","updated_at":"2018-04-06T16:57:17Z","author_association":"MEMBER","body":"Thanks for contributing!\r\n\r\nWe are no longer releasing bug fixes for versions of Electron older than 1.5. We prefer to only keep issues that are on our immediate radar.\r\n\r\nIf you are still having the same issue in an up-to-date version, feel free to reach out and we'll reopen."}}
{"actor":{"display_login":"sofianguy"}}