{"action":"created","issue":{"url":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues/3909","repository_url":"https://api.github.com/repos/RocketChat/Rocket.Chat","labels_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues/3909/labels{/name}","comments_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues/3909/comments","events_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues/3909/events","html_url":"https://github.com/RocketChat/Rocket.Chat/issues/3909","id":169169446,"number":3909,"title":"CORS broken: OPTIONS requests returns 500 Internal Server Error","user":{"login":"tchap","id":697127,"avatar_url":"https://avatars.githubusercontent.com/u/697127?v=3","gravatar_id":"","url":"https://api.github.com/users/tchap","html_url":"https://github.com/tchap","followers_url":"https://api.github.com/users/tchap/followers","following_url":"https://api.github.com/users/tchap/following{/other_user}","gists_url":"https://api.github.com/users/tchap/gists{/gist_id}","starred_url":"https://api.github.com/users/tchap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tchap/subscriptions","organizations_url":"https://api.github.com/users/tchap/orgs","repos_url":"https://api.github.com/users/tchap/repos","events_url":"https://api.github.com/users/tchap/events{/privacy}","received_events_url":"https://api.github.com/users/tchap/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-08-03T16:03:12Z","updated_at":"2016-08-04T09:07:06Z","closed_at":null,"body":"Your Rocket.Chat version: 0.35.0\r\n\r\nAnyway, I am trying to make an API call from the browser. It sends an `OPTIONS` request before `POST` to `/api/logon` to check CORS. The thing is, I am getting `500 Internal Server Error` on this `OPTIONS` request, which is rendering Rocket Chat impossible to access from the browser.\r\n"},"comment":{"url":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues/comments/237496505","html_url":"https://github.com/RocketChat/Rocket.Chat/issues/3909#issuecomment-237496505","issue_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues/3909","id":237496505,"user":{"login":"tchap","id":697127,"avatar_url":"https://avatars.githubusercontent.com/u/697127?v=3","gravatar_id":"","url":"https://api.github.com/users/tchap","html_url":"https://github.com/tchap","followers_url":"https://api.github.com/users/tchap/followers","following_url":"https://api.github.com/users/tchap/following{/other_user}","gists_url":"https://api.github.com/users/tchap/gists{/gist_id}","starred_url":"https://api.github.com/users/tchap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tchap/subscriptions","organizations_url":"https://api.github.com/users/tchap/orgs","repos_url":"https://api.github.com/users/tchap/repos","events_url":"https://api.github.com/users/tchap/events{/privacy}","received_events_url":"https://api.github.com/users/tchap/received_events","type":"User","site_admin":false},"created_at":"2016-08-04T09:07:06Z","updated_at":"2016-08-04T09:07:06Z","body":"```javascript\r\nlogon(username: string, password: string) : Observable<Credentials> {\r\n  const url = `${BASE_URL}/api/login`;\r\n\r\n  const headers = new Headers({\r\n    'Content-Type': 'x-www-form-urlencoded'\r\n  });\r\n\r\n  const body = encodeURIComponent(`user=${username}&password=${password}`).replace('%20', '+');\r\n\r\n  // Send the POST request.\r\n```\r\n\r\nBut the call that is failing really is `OPTIONS` that the browser sends before this request. This request is not even being sent, so not sure why it is important..."}}
{"actor":{"display_login":"tchap"}}