fix GH-211, set CORS headers when sending error message
Merge pull request #258 from mokesmokes/fix211

fix GH-211, set CORS headers when sending error message