Adding support for 'empty' POST body (if forced by --method)

This commit is contained in:
Miroslav Stampar 2015-08-31 14:43:41 +02:00
parent 265a78b455
commit 401564898d

View File

@ -92,8 +92,8 @@ def _setRequestParams():
# Perform checks on POST parameters
if conf.method == HTTPMETHOD.POST and conf.data is None:
errMsg = "HTTP POST method depends on HTTP data value to be posted"
raise SqlmapSyntaxException(errMsg)
logger.warn("detected empty POST body")
conf.data = ""
if conf.data is not None:
conf.method = HTTPMETHOD.POST if not conf.method or conf.method == HTTPMETHOD.GET else conf.method