Revision 0e632cbd

b/lib/http/__init__.py
323 323
  code = 505
324 324

  
325 325

  
326
def ParseHeaders(buf):
327
  """Parses HTTP headers.
328

  
329
  @note: This is just a trivial wrapper around C{mimetools.Message}
330

  
331
  """
332
  return mimetools.Message(buf, 0)
333

  
334

  
326 335
def SocketOperation(sock, op, arg1, timeout):
327 336
  """Wrapper around socket functions.
328 337

  
......
998 1007
    """
999 1008
    # Parse headers
1000 1009
    self.header_buffer.seek(0, 0)
1001
    self.msg.headers = mimetools.Message(self.header_buffer, 0)
1010
    self.msg.headers = ParseHeaders(self.header_buffer, 0)
1002 1011

  
1003 1012
    self.peer_will_close = self._WillPeerCloseConnection()
1004 1013

  
b/lib/rapi/testutils.py
25 25

  
26 26
import logging
27 27
import re
28
import mimetools
29 28
import base64
30 29
import pycurl
31 30
from cStringIO import StringIO
......
172 171
    else:
173 172
      baseheaders = ""
174 173

  
175
    headers = mimetools.Message(StringIO(baseheaders), 0)
174
    headers = http.ParseHeaders(StringIO(baseheaders))
176 175

  
177 176
    if request_body:
178 177
      headers[http.HTTP_CONTENT_LENGTH] = str(len(request_body))

Also available in: Unified diff