Minor refactoring · codezero02/sqlmap@dc7f2a7 · GitHub
Skip to content

Commit dc7f2a7

Browse files
committed
Minor refactoring
1 parent 273679f commit dc7f2a7

3 files changed

Lines changed: 16 additions & 12 deletions

File tree

‎lib/core/settings.py‎

Lines changed: 6 additions & 0 deletions

‎lib/utils/api.py‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
from lib.core.log import LOGGER_HANDLER
3737
from lib.core.optiondict import optDict
3838
from lib.core.settings import IS_WIN
39+
from lib.core.settings import RESTAPI_DEFAULT_ADDRESS
40+
from lib.core.settings import RESTAPI_DEFAULT_PORT
3941
from lib.core.subprocessng import Popen
4042
from lib.parse.cmdline import cmdLineParser
4143
from thirdparty.bottle.bottle import error as return_error
@@ -46,9 +48,6 @@
4648
from thirdparty.bottle.bottle import response
4749
from thirdparty.bottle.bottle import run
4850

49-
RESTAPI_SERVER_HOST = "127.0.0.1"
50-
RESTAPI_SERVER_PORT = 8775
51-
5251

5352
# global settings
5453
class DataStore(object):
@@ -638,7 +637,7 @@ def download(taskid, target, filename):
638637
return jsonize({"success": False, "message": "File does not exist"})
639638

640639

641-
def server(host="0.0.0.0", port=RESTAPI_SERVER_PORT):
640+
def server(host=RESTAPI_DEFAULT_ADDRESS, port=RESTAPI_DEFAULT_PORT):
642641
"""
643642
REST-JSON API server
644643
"""
@@ -680,7 +679,7 @@ def _client(url, options=None):
680679
return text
681680

682681

683-
def client(host=RESTAPI_SERVER_HOST, port=RESTAPI_SERVER_PORT):
682+
def client(host=RESTAPI_DEFAULT_ADDRESS, port=RESTAPI_DEFAULT_PORT):
684683
"""
685684
REST-JSON API client
686685
"""

‎sqlmapapi.py‎

Lines changed: 6 additions & 7 deletions

0 commit comments

Comments
 (0)