def referrer_policy(reqs: dict, expectation='referrer-policy-private') -> dict:
    """
    :param reqs: dictionary containing all the request and response objects
    :param expectation: test expectation
        referrer-policy-private: Referrer-Policy header set to "no-referrer" or "same-origin", "strict-origin"
          or "strict-origin-when-origin"
        referrer-policy-no-referrer-when-downgrade: Referrer-Policy header set to "no-referrer-when-downgrade"
        referrer-policy-origin: Referrer-Policy header set to "origin"
        referrer-policy-origin-when-cross-origin: Referrer-Policy header set to "origin-when-cross-origin"
        referrer-policy-unsafe-url: Referrer-Policy header set to "unsafe-url"
        referrer-policy-not-implemented: Referrer-Policy header not implemented
        referrer-policy-header-invalid
    :return: dictionary with:
        data: the raw HTTP Referrer-Policy header
        expectation: test expectation
        pass: whether the site's configuration met its expectation
        result: short string describing the result of the test
    """

    output = {
        'data': None,
        'expectation': expectation,
        'http': False,    # whether an HTTP header was available
        'meta': False,    # whether an HTTP meta-equiv was available
        'pass': False,
        'result': None,
    }

    goodness = ['no-referrer',
                'same-origin',
                'strict-origin',
                'strict-origin-when-cross-origin']

    badness = ['origin',
               'origin-when-cross-origin',
               'unsafe-url']

    valid = goodness + badness + ['no-referrer-when-downgrade']

    response = reqs['responses']['auto']

    # Store whether the header or meta were present
    output['http'] = True if 'Referrer-Policy' in response.headers else False
    output['meta'] = True if 'Referrer-Policy' in response.http_equiv else False

    # If it's in both a header and http-equiv, http-equiv gets precedence (aka comes last)
    if 'Referrer-Policy' in response.headers and 'Referrer-Policy' in response.http_equiv:
        output['data'] = ', '.join([response.headers['Referrer-Policy'],
                                   response.http_equiv['Referrer-Policy']])[0:256]  # Code defensively
    elif 'Referrer-Policy' in response.headers or 'Referrer-Policy' in response.http_equiv:
        output['data'] = (response.http_equiv.get('Referrer-Policy') or response.headers.get('Referrer-Policy'))[0:256]
    else:
        output['result'] = 'referrer-policy-not-implemented'
        output['pass'] = True
        return output

    # Find the last known valid policy value in the Referer Policy
    policy = [token.strip() for token in output['data'].lower().split(',') if token.strip() in valid]
    policy = policy.pop() if policy else None

    if policy in goodness:
        output['result'] = 'referrer-policy-private'
    elif policy == 'no-referrer-when-downgrade':
        output['result'] = 'referrer-policy-no-referrer-when-downgrade'
    elif policy in badness:
        output['result'] = 'referrer-policy-unsafe'
    else:
        output['result'] = 'referrer-policy-header-invalid'

    # Test passed or failed
    if output['result'] in ('referrer-policy-private',
                            'referrer-policy-not-implemented',
                            'referrer-policy-no-referrer-when-downgrade',
                            expectation):
        output['pass'] = True

    return output