ReportItemsController.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:cerberus-core 作者: ovh 项目源码 文件源码
def get_http_headers(url):
    """
        Get HTTP headers for given url
    """
    if not url:
        raise BadRequest('Missing url')

    url = _get_deobfuscate_item(url)
    try:
        validate = URLValidator(schemes=('http', 'https', 'ftp', 'ftps', 'rtsp', 'rtmp'))
        validate(url)
    except ValidationError:
        raise BadRequest('Not a valid URL')

    try:
        response = ImplementationFactory.instance.get_singleton_of(
            'PhishingServiceBase'
        ).get_http_headers(url)
        schema.valid_adapter_response('PhishingServiceBase', 'get_http_headers', response)
        return response
    except (PhishingServiceException, schema.InvalidFormatError, schema.SchemaNotFound) as ex:
        raise InternalServerError(str(ex))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号