/**
value should have the following format
{
  body: {
    responseType: '',
    responseText: value,
    status: '',
    statusText: ''
  },
  headers: {
    // map of HTTP response headers
  }
}
*/
export default function hydrate (value) {
  const headers = data.headers || {}
  const xhr = value.body || {}

  xhr.getAllResponseHeaders = function () {
    return headers
  }

  xhr.getResponseHeader = function (header) {
    return headers[header]
  }

  return xhr
}

@@ -150,164 +150,674 @@
 rs: 
-%7B%0A    // map of HTTP r
+''%0A%7D%0A*/%0A%0A// borrow from superagent%0Afunction trim (s) %7B%0A  return ''.trim ? s.trim(s) : s.replace(/(%5E%5Cs*%7C%5Cs*$)/g, '')%0A%7D%0A%0A// borrow from superagent%0Afunction parseHeader (str) %7B%0A  var lines = str.split(/%5Cr?%5Cn/)%0A  var fields = %7B%7D%0A  var index%0A  var line%0A  var field%0A  var val%0A%0A  lin
 es
+.
 po
-nse headers%0A  %7D%0A%7D%0A*/%0Aexport default function hydrate (value) %7B%0A  const headers = data.headers %7C%7C %7B%7D%0A  const xhr = value.body
+p() // trailing CRLF%0A%0A  for (let i = 0, len = lines.length; i %3C len; i += 1) %7B%0A    line = lines%5Bi%5D%0A    index = line.indexOf(':')%0A    field = line.slice(0, index).toLowerCase()%0A    val = trim(line.slice(index + 1))%0A    fields%5Bfield%5D = val%0A  %7D%0A%0A  return fields%0A%7D%0A%0Aexport default function hydrate (value) %7B%0A  const xhr = value.body %7C%7C %7B%7D%0A  const headers = parseHeader(value.headers
  %7C%7C %7B%7D
+)
 %0A%0A  
@@ -865,24 +865,30 @@
 %0A    return 
+value.
 headers%0A  %7D%0A

support headers serialization from string