self.version = None
self._content = StringIO(self.recorded_response['body']['string'])
+ # We are skipping the header parsing (they have already been parsed
+ # at this point) and directly adding the headers to the header
+ # container, so just pass an empty StringIO.
self.msg = HTTPMessage(StringIO(''))
+
for key, val in self.recorded_response['headers'].iteritems():
self.msg.addheader(key, val)
+ # msg.addheaders adds the headers to msg.dict, but not to
+ # the msg.headers list representation of headers, so
+ # I have to add it to both.
+ self.msg.headers.append("{0}:{1}".format(key, val))
+
+ #self.msg.headers = ["{0}:{1}".format(k,v) for k, v in self.recorded_response['headers'].iteritems()]
self.length = self.msg.getheader('content-length') or None