Closed ghost closed 6 years ago
I dont think this is an issue with this plugin. From the hapi documentation, seems like at the "onPreResponse" extension point, the request.response
object can either be a "boom error" or an actual response object, in case it is a "boom error" then the object does not have the "header" method because it is not a response object, but a boom error. I think you should check for the isBoom
property, and use reply.continue()
in such cases to avoid the error.
See:
The reason you are getting the error, is likely because crumb sometimes responds with "boom errors".
Closing due inactivity. Please feel free to open this again if none of my suggestions worked and the issue persists.
Also note that, the reason you are getting boom errors when registering this plugin, is likely because your api request are not sending the proper csrf token. Anyway, as I mentioned before the actual issue is caused because errors are not being checked at the extension point.
As soon as I register the crumb plugin, an error TypeError: Uncaught Error: request.response.header() is not a function.
server.js
RateLimiter.js
Throttler.js