lib/browser/request.js
function(xhr) {
    var response = {
        headers: {},
        statusCode: xhr.status
    };

    var headerPairs = xhr.getAllResponseHeaders().split('\u000d\u000a');
    for (var i = 0; i < headerPairs.length; i++) {
        var headerPair = headerPairs[i],
            index = headerPair.indexOf('\u003a\u0020');

        if (index > 0) {
            var key = headerPair.substring(0, index);
            var val = headerPair.substring(index + 2);
            response.headers[key.toLowerCase()] = val;
        }
    }

    return response;
}
function(xhr) {
    var response = {
        headers: {},
        statusCode: xhr.status
    };

    var headerPairs = xhr.getAllResponseHeaders().split('\u000d\u000a');
    for (var i = 0; i < headerPairs.length; i++) {
        var headerPair = headerPairs[i],
            index = headerPair.indexOf('\u003a\u0020');

        if (index > 0) {
            var key = headerPair.substring(0, index);
            var val = headerPair.substring(index + 2);
            response.headers[key.toLowerCase()] = val;
        }
    }

    return response;
}
function ( xhr ) { var response = { headers : { } , statusCode : xhr . status } ; var headerPairs = xhr . getAllResponseHeaders ( ) . split ( '\u000d\u000a' ) ; for ( var i = 0 ; i < headerPairs . length ; i ++ ) { var headerPair = headerPairs [ i ] , index = headerPair . indexOf ( '\u003a\u0020' ) ; if ( index > 0 ) { var key = headerPair . substring ( 0 , index ) ; var val = headerPair . substring ( index + 2 ) ; response . headers [ key . toLowerCase ( ) ] = val ; } } return response ; }
Normalize a response into a common format for both environments

@param  {XMLHttpRequest} xhr
@return {Object}
Normalize a response into a common format for both environments