{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/CORS/issues/56","labels_url":"https://api.github.com/repos/aspnet/CORS/issues/56/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/CORS/issues/56/comments","events_url":"https://api.github.com/repos/aspnet/CORS/issues/56/events","html_url":"https://github.com/aspnet/CORS/issues/56","id":121143437,"number":56,"title":"CORS is not enabled when there is any error occured","user":{"login":"TonyWoo","id":689710,"avatar_url":"https://avatars.githubusercontent.com/u/689710?v=3","gravatar_id":"","url":"https://api.github.com/users/TonyWoo","html_url":"https://github.com/TonyWoo","followers_url":"https://api.github.com/users/TonyWoo/followers","following_url":"https://api.github.com/users/TonyWoo/following{/other_user}","gists_url":"https://api.github.com/users/TonyWoo/gists{/gist_id}","starred_url":"https://api.github.com/users/TonyWoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TonyWoo/subscriptions","organizations_url":"https://api.github.com/users/TonyWoo/orgs","repos_url":"https://api.github.com/users/TonyWoo/repos","events_url":"https://api.github.com/users/TonyWoo/events{/privacy}","received_events_url":"https://api.github.com/users/TonyWoo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-09T01:59:24Z","updated_at":"2015-12-10T18:21:12Z","closed_at":null,"body":"I enabled the CORS support using Microsoft.AspNet.Cors.Core(6.0.0-beta8) and Microsoft.AspNet.Cors (6.0.0-rc1-final) in a ASP.NET 5 RC1 project.\r\n\r\nIt is ok when the api called succeeded. \r\n\r\nBut when I use JWT bearer middleware and provided a invalid token, the middleware throw an 500 error, then the CORS is not enabled, no Access-Control-Allow-Origin in the HTTP headers.  Can you help how to add the CORS when there is any error occurred? Thanks."},"comment":{"url":"https://api.github.com/repos/aspnet/CORS/issues/comments/163708366","html_url":"https://github.com/aspnet/CORS/issues/56#issuecomment-163708366","issue_url":"https://api.github.com/repos/aspnet/CORS/issues/56","id":163708366,"user":{"login":"andrevlins","id":5325718,"avatar_url":"https://avatars.githubusercontent.com/u/5325718?v=3","gravatar_id":"","url":"https://api.github.com/users/andrevlins","html_url":"https://github.com/andrevlins","followers_url":"https://api.github.com/users/andrevlins/followers","following_url":"https://api.github.com/users/andrevlins/following{/other_user}","gists_url":"https://api.github.com/users/andrevlins/gists{/gist_id}","starred_url":"https://api.github.com/users/andrevlins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrevlins/subscriptions","organizations_url":"https://api.github.com/users/andrevlins/orgs","repos_url":"https://api.github.com/users/andrevlins/repos","events_url":"https://api.github.com/users/andrevlins/events{/privacy}","received_events_url":"https://api.github.com/users/andrevlins/received_events","type":"User","site_admin":false},"created_at":"2015-12-10T18:21:12Z","updated_at":"2015-12-10T18:21:12Z","body":"I'm having the same issue with RC1"}}