{"action":"opened","issue":{"url":"https://api.github.com/repos/vladislav805/APIdogPlusExtension/issues/8","repository_url":"https://api.github.com/repos/vladislav805/APIdogPlusExtension","labels_url":"https://api.github.com/repos/vladislav805/APIdogPlusExtension/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/vladislav805/APIdogPlusExtension/issues/8/comments","events_url":"https://api.github.com/repos/vladislav805/APIdogPlusExtension/issues/8/events","html_url":"https://github.com/vladislav805/APIdogPlusExtension/issues/8","id":386496545,"node_id":"MDU6SXNzdWUzODY0OTY1NDU=","number":8,"title":"User-Agent and Cookie headers break LongPoll","user":{"login":"dvalter","id":38795282,"node_id":"MDQ6VXNlcjM4Nzk1Mjgy","avatar_url":"https://avatars3.githubusercontent.com/u/38795282?v=4","gravatar_id":"","url":"https://api.github.com/users/dvalter","html_url":"https://github.com/dvalter","followers_url":"https://api.github.com/users/dvalter/followers","following_url":"https://api.github.com/users/dvalter/following{/other_user}","gists_url":"https://api.github.com/users/dvalter/gists{/gist_id}","starred_url":"https://api.github.com/users/dvalter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dvalter/subscriptions","organizations_url":"https://api.github.com/users/dvalter/orgs","repos_url":"https://api.github.com/users/dvalter/repos","events_url":"https://api.github.com/users/dvalter/events{/privacy}","received_events_url":"https://api.github.com/users/dvalter/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-01T20:51:20Z","updated_at":"2018-12-01T20:51:20Z","closed_at":null,"author_association":"NONE","body":"Setting request headers \"Cookie\" and \"User-Agent\" is not permitted in Chromium (at least 69+) with error `Refused to set unsafe header \"<header>\"`\r\n\r\nI'm not web developer, simply commenting out the following lines works for me pretty well in Chromium.\r\n\r\n```diff\r\n--- a/libapidog0.js\r\n+++ b/libapidog0.js\r\n@@ -115,8 +115,8 @@ RequestTask.prototype = {\r\n        __send: function(body) {\r\n                this.xhr.open(this.type, this.url, true);\r\n                this.xhr.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\r\n-               this.xhr.setRequestHeader(\"User-Agent\", LongPoll.userAgent);\r\n-               this.xhr.setRequestHeader(\"Cookie\", \"\");\r\n+               // this.xhr.setRequestHeader(\"User-Agent\", LongPoll.userAgent);\r\n+               // this.xhr.setRequestHeader(\"Cookie\", \"\");\r\n                this.xhr.send(this.type === \"POST\" ? body : null);\r\n                return this;\r\n        },\r\n@@ -391,4 +391,4 @@ sendEvent(METHOD_ACCESS_TOKEN_REQUIRE, {}, EVENT_ACCESS_TOKEN_RECEIVED);\r\n```\r\n\r\nFirefox does not have this issue and after my fix it works as fine as it did."}}
{"actor":{"display_login":"dvalter"}}