square/okhttp — pull request #1022 by seato (2014-08-14 16:37:13+00:00)
Title: Request/Response Interceptor Implementation

Tests added that check a couple of different cases for "early" request interceptors and response interceptors. In addition, there's also the implementation for said interceptors which pass said tests.

Tests include:
transformUserAgentRequestCachedResponse test: "early" request interceptor changes the user agent
transformStatusCodeResponse test: response interceptor alters the status code
transformServerHeaderResponse test: response interceptor alters the header
multipleTransformStatusCodeResponse test: multiple response interceptors change the status code. Ensures that the interceptors are being invoked in the correct order.

"Network" interceptor (affects request if the cache doesn't return a response) tests were not included because a proper test requires a cache mock object that doesn't currently exist in okHttp.

Closes https://github.com/square/okhttp/issues/993.