function extractRedirectInfo(location) {
    const redirectInfo = { redirectLocationHeader: true };
    if (location.startsWith('/')) {
        // redirect to another object in bucket
        redirectInfo.replaceKeyWith = location.slice(1);
        // when redirect info is set by x-amz-website-redirect-location header
        // to another key in the same bucket
        // AWS only returns the path in the location response header
        redirectInfo.justPath = true;
    } else if (location.startsWith('https')) {
        // otherwise, redirect to another website
        redirectInfo.protocol = 'https';
        redirectInfo.hostName = location.slice(8);
    } else {
        redirectInfo.protocol = 'http';
        redirectInfo.hostName = location.slice(7);
    }
    return redirectInfo;
}
extractRedirectInfo - convert location saved from x-amz-website header to
same format as redirectInfo saved from a put bucket website configuration
@param {string} location - location to redirect to
@return {object} redirectInfo - select key/values stored in
WebsiteConfiguration for a redirect -- protocol, replaceKeyWith and hostName