     var minorVersion: Int = 0
     var headers: [String: String] = [:]
     var body: [Int8] = []
-    
+
+    var buildingHeaderField = ""
     var currentHeaderField = ""
     var completion: HTTPResponse -> Void
 

func onResponseHeadersComplete(parser: UnsafeMutablePointer<http_parser>) -> Int32 {
    let context = UnsafeMutablePointer<HTTPResponseParserContext>(parser.memory.data)

    context.memory.currentHeaderField = ""
    context.memory.statusCode = Int(parser.memory.status_code)
    context.memory.majorVersion = Int(parser.memory.http_major)


    var buffer: [Int8] = [Int8](count: length + 1, repeatedValue: 0)
    strncpy(&buffer, data, length)
    if context.memory.buildingHeaderField != "" {
        context.memory.currentHeaderField = context.memory.buildingHeaderField
    }
    context.memory.buildingHeaderField = ""
    let headerField = context.memory.currentHeaderField
    let previousHeaderValue = context.memory.headers[headerField] ?? ""
    context.memory.headers[headerField] = previousHeaderValue + String.fromCString(buffer)!
