function convertResponseHeaders(source) {
        var newline = /\r?\n/;
        var headers = {};

        if (!source) {
            return headers;
        }

        source = source.trim();
        source = source.split(newline);

        source.forEach(function onEntry(header) {
            var position = header.indexOf(':');
            var key = header.substr(0, position);
            var value = header.substr(position + 1).trim();

            headers[key] = value;
        });

        return headers;
    }
The XHR object returns a string with all response header entries in the form:

    key: "value"

This function converts this string to an object representation.

@param {String} source The headers from the XHR object.

@returns {Object}