ctx.throw || ctx.assert doesn't send the headers back
Nighthawk14 opened this issue · 4 comments
Nighthawk14 commented
When using ctx.throw
or ctx.assert
the cors headers are not sent back. Maybe I'm using it wrong but any help would be welcome :).
example:
router.post('/', (ctx) => {
let {name, jurisdiction, parentTitle} = ctx.request.body;
const project = ctx.request.body;
ctx.assert(name && jurisdiction && parentTitle, 400);
Thanks!
dead-horse commented
what version of koa and kcors are you using?
Nighthawk14 commented
koa@2.0.0-alpha.3 and kcors@2.1.1 :)
On 28 Jul 2016, at 4:47 PM, Yiyu He notifications@github.com wrote:
what version of koa and kcors are you using?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
dead-horse commented
if you are using default error handler in koa, please update your koa to 2.0.0-beta.4
Nighthawk14 commented
@dead-horse Thanks for the help, it's definitely better! 😃