2020"""
2121
2222__docformat__ = 'restructuredtext'
23- __version__ = '0.0.9 '
23+ __version__ = '0.0.10 '
2424
2525import requests
2626from requests .packages .urllib3 .exceptions import InsecureRequestWarning
2727
28- from acsrf import acsrf
29- from ascan import ascan
30- from ajaxSpider import ajaxSpider
31- from authentication import authentication
32- from authorization import authorization
33- from autoupdate import autoupdate
34- from brk import brk
35- from context import context
36- from core import core
37- from forcedUser import forcedUser
38- from httpSessions import httpSessions
39- from importLogFiles import importLogFiles
40- from params import params
41- from pnh import pnh
42- from pscan import pscan
43- from reveal import reveal
44- from script import script
45- from search import search
46- from selenium import selenium
47- from sessionManagement import sessionManagement
48- from spider import spider
49- from stats import stats
50- from users import users
28+ from . acsrf import acsrf
29+ from . ascan import ascan
30+ from . ajaxSpider import ajaxSpider
31+ from . authentication import authentication
32+ from . authorization import authorization
33+ from . autoupdate import autoupdate
34+ from . brk import brk
35+ from . context import context
36+ from . core import core
37+ from . forcedUser import forcedUser
38+ from . httpSessions import httpSessions
39+ from . importLogFiles import importLogFiles
40+ from . params import params
41+ from . pnh import pnh
42+ from . pscan import pscan
43+ from . reveal import reveal
44+ from . script import script
45+ from . search import search
46+ from . selenium import selenium
47+ from . sessionManagement import sessionManagement
48+ from . spider import spider
49+ from . stats import stats
50+ from . users import users
5151
5252
5353class ZAPv2 (object ):
5454 """
5555 Client API implementation for integrating with ZAP v2.
5656 """
57- # base JSON api url
5857 base = 'http://zap/JSON/'
59-
60- # base OTHER api url
6158 base_other = 'http://zap/OTHER/'
6259
6360 def __init__ (self , proxies = None , apikey = None ):
@@ -109,7 +106,7 @@ def __init__(self, proxies=None, apikey=None):
109106 #if apikey is not None:
110107 # self.session.headers['X-ZAP-API-Key'] = apikey
111108
112- def urlopen (self , * args , ** kwargs ):
109+ def urlopen (self , url , * args , ** kwargs ):
113110 """
114111 Opens a url forcing the proxies to be used.
115112
@@ -118,7 +115,7 @@ def urlopen(self, *args, **kwargs):
118115 - `kwargs`: all other keyword arguments.
119116 """
120117 # Must never leak the API key via proxied requests
121- return requests .get (* args , proxies = self .__proxies , verify = False , ** kwargs ).text
118+ return requests .get (url , proxies = self .__proxies , verify = False , * args , ** kwargs ).text
122119
123120 def _request_api (self , url , query = None ):
124121 """
@@ -153,7 +150,8 @@ def _request(self, url, get=None):
153150 - `url`: the url to GET at.
154151 - `get`: the dictionary to turn into GET variables.
155152 """
156- return self ._request_api (url , get ).json ()
153+ data = self ._request_api (url , get )
154+ return data .json ()
157155
158156 def _request_other (self , url , get = None ):
159157 """
@@ -163,4 +161,5 @@ def _request_other(self, url, get=None):
163161 - `url`: the url to GET at.
164162 - `get`: the dictionary to turn into GET variables.
165163 """
166- return self ._request_api (url , get ).text
164+ data = self ._request_api (url , get )
165+ return data .text
0 commit comments