'Handler for HTTP GET/HEAD requests.'

def GETorHEAD(self, req):

    '\n                                Handles    requests    to    /info\n                                Should    return    a    WSGI-style    callable    (such    as    swob.Response).\n\n                                :param    req:    swob.Request    object\n                                '
    if (not self.expose_info):
        return HTTPForbidden(request=req)
    admin_request = False
    sig = req.params.get('swiftinfo_sig', '')
    expires = req.params.get('swiftinfo_expires', '')
    if ((sig != '') or (expires != '')):
        admin_request = True
        if (not self.admin_key):
            return HTTPForbidden(request=req)
        try:
            expires = int(expires)
        except ValueError:
            return HTTPUnauthorized(request=req)
        if (expires < time()):
            return HTTPUnauthorized(request=req)
        valid_sigs = []
        for method in self.allowed_hmac_methods[req.method]:
            valid_sigs.append(get_hmac(method, '/info', expires, self.admin_key))
        is_valid_hmac = any((streq_const_time(valid_sig, sig) for valid_sig in valid_sigs))
        if (not is_valid_hmac):
            return HTTPUnauthorized(request=req)
    headers = {}
    if ('Origin' in req.headers):
        headers['Access-Control-Allow-Origin'] = req.headers['Origin']
        headers['Access-Control-Expose-Headers'] = ',    '.join(['x-trans-id'])
    info = json.dumps(get_swift_info(admin=admin_request, disallowed_sections=self.disallowed_sections))
    return HTTPOk(request=req, headers=headers, body=info, content_type='application/json;    charset=UTF-8')
