toymachiner62 / hapi-authorization

ACL plugin for hapijs
MIT License
80 stars 25 forks source link

Add test for issue causing the response to remain open and never finish #15

Closed msurdi closed 8 years ago

msurdi commented 8 years ago

Hi!

I've found an issue after upgrading to hapi-authorization 3.0.0. If you just throw an exception in a Hapi handler, then the response stays open and hangs forever.

I managed to create a test reproducing the problem here, to me it looks like the solution would be to avoid the global try/catch in onPreHandler or catching the specific errors thrown by hapi-authorization itself and not every exception. But not sure if that would be the best solution, probably you know better than me. Thanks for your help.

msurdi commented 8 years ago

I think I've found a solution, I'd appreciate if you could give a look at this.

Thanks.

toymachiner62 commented 8 years ago

Version 3.0.1 published to npm.