cujojs / rest

RESTful HTTP client for JavaScript
http://cujojs.com/
Other
1k stars 146 forks source link

interceptor class exist a Asynchronous time-consuming problem #139

Closed crixusshen closed 8 years ago

crixusshen commented 8 years ago

interceptor class#121: requestHandler.call(context, request, config, meta), If requestHandler is a Asynchronous time-consuming function, Access to the variable 'request' will be 'undefined'

scothis commented 8 years ago

@crixusshen can you provide an example that demonstrates the behavior you describe? All request/response interceptor methods are async and time-consuming since Promises will always resolve in the next tick.

One thing to keep in mind is that you must return the request/response object in the handler. Not returning the request/response would cause it to become undefined.

scothis commented 8 years ago

Stale. @crixusshen please reopen if you can show an issue.