ctx.throw || ctx.assert doesn't send the headers back
Nighthawk14 opened this issue · comments
Antoine Savignac 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!
Yiyu He commented
what version of koa and kcors are you using?
Antoine Savignac 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.
Yiyu He commented
if you are using default error handler in koa, please update your koa to 2.0.0-beta.4
Antoine Savignac commented
@dead-horse Thanks for the help, it's definitely better! 😃