r47027 - Apply patch from lukasa.

mithrandi-TA+aISz0psMTMxyoc4vAAJOcrHinNvQL0E9HWUfgJXw@public.gmane.org Fri, 18 Mar 2016 13:23:28 -0600 (MDT)
Newsgroups gmane.comp.python.twisted.commits
Message-ID <[email protected]>
Author: mithrandi
Date: Fri Mar 18 13:23:25 2016
New Revision: 47027

Modified:
   branches/static-proxy-object-8238/twisted/web/_newclient.py

Log:
Apply patch from lukasa.

Modified: branches/static-proxy-object-8238/twisted/web/_newclient.py
==============================================================================
--- branches/static-proxy-object-8238/twisted/web/_newclient.py	(original)
+++ branches/static-proxy-object-8238/twisted/web/_newclient.py	Fri Mar 18 13:23:25 2016
@@ -919,6 +919,14 @@
 
 
 
+# This proxy class is used only in the private constructor of the Response
+# class below, in order to prevent users relying on any property of the
+# concrete request object: they can only use what is provided by
+# IClientRequest.
+_ClientRequestProxy = proxyForInterface(IClientRequest)
+
+
+
 @implementer(IResponse)
 class Response:
     """
@@ -1012,7 +1020,7 @@
         @return: L{Response} instance.
         """
         response = Response(version, code, phrase, headers, _transport)
-        response.request = proxyForInterface(IClientRequest)(request)
+        response.request = _ClientRequestProxy(request)
         return response