當前位置: 首頁>>代碼示例>>Python>>正文


Python request.unverifiable方法代碼示例

本文整理匯總了Python中urllib.request.unverifiable方法的典型用法代碼示例。如果您正苦於以下問題:Python request.unverifiable方法的具體用法?Python request.unverifiable怎麽用?Python request.unverifiable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在urllib.request的用法示例。


在下文中一共展示了request.unverifiable方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: is_third_party

# 需要導入模塊: from urllib import request [as 別名]
# 或者: from urllib.request import unverifiable [as 別名]
def is_third_party(request):
    """

    RFC 2965, section 3.3.6:

        An unverifiable transaction is to a third-party host if its request-
        host U does not domain-match the reach R of the request-host O in the
        origin transaction.

    """
    req_host = request_host(request)
    if not domain_match(req_host, reach(request.origin_req_host)):
        return True
    else:
        return False 
開發者ID:Microvellum,項目名稱:Fluid-Designer,代碼行數:17,代碼來源:cookiejar.py

示例2: set_ok_verifiability

# 需要導入模塊: from urllib import request [as 別名]
# 或者: from urllib.request import unverifiable [as 別名]
def set_ok_verifiability(self, cookie, request):
        if request.unverifiable and is_third_party(request):
            if cookie.version > 0 and self.strict_rfc2965_unverifiable:
                _debug("   third-party RFC 2965 cookie during "
                             "unverifiable transaction")
                return False
            elif cookie.version == 0 and self.strict_ns_unverifiable:
                _debug("   third-party Netscape cookie during "
                             "unverifiable transaction")
                return False
        return True 
開發者ID:Microvellum,項目名稱:Fluid-Designer,代碼行數:13,代碼來源:cookiejar.py

示例3: return_ok_verifiability

# 需要導入模塊: from urllib import request [as 別名]
# 或者: from urllib.request import unverifiable [as 別名]
def return_ok_verifiability(self, cookie, request):
        if request.unverifiable and is_third_party(request):
            if cookie.version > 0 and self.strict_rfc2965_unverifiable:
                _debug("   third-party RFC 2965 cookie during unverifiable "
                       "transaction")
                return False
            elif cookie.version == 0 and self.strict_ns_unverifiable:
                _debug("   third-party Netscape cookie during unverifiable "
                       "transaction")
                return False
        return True 
開發者ID:Microvellum,項目名稱:Fluid-Designer,代碼行數:13,代碼來源:cookiejar.py


注:本文中的urllib.request.unverifiable方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。