-
Notifications
You must be signed in to change notification settings - Fork 62
Description
A follow up to #90
I may have spoken too soon. While the caching works as expected, it seems that it doesn't play quite well with swagger response validation.
It seems that cached response streamed to the http response [1] with the headers etc. set and when the validator's response end is called, data passed to res.end [2] is undefined. This leads response validation error and an attempt to send headers twice (since the cache already wrote to the response)
Without further debugging I can't say much at this point sadly. I'm on Node 4.2.1 by the way. Seeing that the cache encoder is using the stream module, this could be important.
[1] https://github.com/apigee-127/volos/blob/master/cache/common/lib/cache-encoder.js#L92
[2] https://github.com/apigee-127/swagger-tools/blob/master/middleware/swagger-validator.js#L176