src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/certificateValidation.py

branch
eric7
changeset 10517
aecd5a8c958c
parent 10507
d1c6608155ef
child 10683
779cda568acb
equal deleted inserted replaced
10516:72baef0baa76 10517:aecd5a8c958c
44 """ 44 """
45 httpVerbs = ("get", "options", "head", "post", "put", "patch", "delete") 45 httpVerbs = ("get", "options", "head", "post", "put", "patch", "delete")
46 httpxAttrs = ("request", "stream", "Client", "AsyncClient") + httpVerbs 46 httpxAttrs = ("request", "stream", "Client", "AsyncClient") + httpVerbs
47 qualName = context.callFunctionNameQual.split(".")[0] 47 qualName = context.callFunctionNameQual.split(".")[0]
48 if ( 48 if (
49 ( 49 (qualName == "requests" and context.callFunctionName in httpVerbs)
50 ( 50 or (qualName == "httpx" and context.callFunctionName in httpxAttrs)
51 qualName == "requests" 51 ) and context.checkCallArgValue("verify", "False"):
52 and context.callFunctionName in httpVerbs
53 )
54 or (
55 qualName == "httpx"
56 and context.callFunctionName in httpxAttrs
57 )
58 )
59 and context.checkCallArgValue("verify", "False")
60 ):
61 reportError( 52 reportError(
62 context.getLinenoForCallArg("verify") - 1, 53 context.getLinenoForCallArg("verify") - 1,
63 context.getOffsetForCallArg("verify"), 54 context.getOffsetForCallArg("verify"),
64 "S501", 55 "S501",
65 "H", 56 "H",

eric ide

mercurial