src/aria/core/transport/BaseXHR.js
function (connection) {
            var headerStr = connection.getAllResponseHeaders(), headers = {};

            if (headerStr) {
                var headerLines = headerStr.split("\n");
                for (var i = 0; i < headerLines.length; i++) {
                    var delimitPos = headerLines[i].indexOf(":");
                    if (delimitPos != -1) {
                        // Trime headers
                        headers[headerLines[i].substring(0, delimitPos)] = headerLines[i].substring(delimitPos + 2).replace(/^\s+|\s+$/g, "");
                    }
                }
            }

            var response = {
                statusText : (connection.status == 1223) ? "No Content" : connection.statusText,
                getResponseHeader : headers,
                getAllResponseHeaders : headerLines,
                responseText : connection.responseText,
                responseXML : connection.responseXML
            };

            return response;
        }
function (connection) {
            var headerStr = connection.getAllResponseHeaders(), headers = {};

            if (headerStr) {
                var headerLines = headerStr.split("\n");
                for (var i = 0; i < headerLines.length; i++) {
                    var delimitPos = headerLines[i].indexOf(":");
                    if (delimitPos != -1) {
                        // Trime headers
                        headers[headerLines[i].substring(0, delimitPos)] = headerLines[i].substring(delimitPos + 2).replace(/^\s+|\s+$/g, "");
                    }
                }
            }

            var response = {
                statusText : (connection.status == 1223) ? "No Content" : connection.statusText,
                getResponseHeader : headers,
                getAllResponseHeaders : headerLines,
                responseText : connection.responseText,
                responseXML : connection.responseXML
            };

            return response;
        }
function ( connection ) { var headerStr = connection . getAllResponseHeaders ( ) , headers = { } ; if ( headerStr ) { var headerLines = headerStr . split ( "\n" ) ; for ( var i = 0 ; i < headerLines . length ; i ++ ) { var delimitPos = headerLines [ i ] . indexOf ( ":" ) ; if ( delimitPos != - 1 ) { // Trime headers headers [ headerLines [ i ] . substring ( 0 , delimitPos ) ] = headerLines [ i ] . substring ( delimitPos + 2 ) . replace ( / ^\s+|\s+$ / g , "" ) ; } } } var response = { statusText : ( connection . status == 1223 ) ? "No Content" : connection . statusText , getResponseHeader : headers , getAllResponseHeaders : headerLines , responseText : connection . responseText , responseXML : connection . responseXML } ; return response ; }
Generate a valid server response.
@protected
@param {Object} connection Connection status
@return {aria.core.CfgBeans:IOAsyncRequestResponseCfg}
Generate a valid server response .