{"action":"opened","issue":{"url":"https://api.github.com/repos/cyclejs/cyclejs/issues/360","repository_url":"https://api.github.com/repos/cyclejs/cyclejs","labels_url":"https://api.github.com/repos/cyclejs/cyclejs/issues/360/labels{/name}","comments_url":"https://api.github.com/repos/cyclejs/cyclejs/issues/360/comments","events_url":"https://api.github.com/repos/cyclejs/cyclejs/issues/360/events","html_url":"https://github.com/cyclejs/cyclejs/issues/360","id":166612974,"number":360,"title":"Calling request.type with json default forces browser to make invalid preflight request","user":{"login":"n-j-m","id":411630,"avatar_url":"https://avatars.githubusercontent.com/u/411630?v=3","gravatar_id":"","url":"https://api.github.com/users/n-j-m","html_url":"https://github.com/n-j-m","followers_url":"https://api.github.com/users/n-j-m/followers","following_url":"https://api.github.com/users/n-j-m/following{/other_user}","gists_url":"https://api.github.com/users/n-j-m/gists{/gist_id}","starred_url":"https://api.github.com/users/n-j-m/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/n-j-m/subscriptions","organizations_url":"https://api.github.com/users/n-j-m/orgs","repos_url":"https://api.github.com/users/n-j-m/repos","events_url":"https://api.github.com/users/n-j-m/events{/privacy}","received_events_url":"https://api.github.com/users/n-j-m/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-20T15:38:46Z","updated_at":"2016-07-20T15:38:46Z","closed_at":null,"body":"I encountered this when trying to make a CORS request to https://www.reddit.com/r/all.json.  I kept getting a failed preflight request even though I was only making a plain GET request.  I tracked the issue to ```request.type``` where it is being defaulted to ```json```. While this may seem innocuous, according to [MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS) the ```Content-Type application/json``` is not a safe header and triggers a preflight request. Reddit blocks all non plain GET CORS requests which led to my error.\r\n\r\nI propose only calling ```request.type``` when the type property is explicitly set in the request options sent to the HTTP driver."}}
{"actor":{"display_login":"n-j-m"}}