mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-24 18:43:47 +03:00
support for swagger v2 body specs
This commit is contained in:
parent
35cb10fd69
commit
051eb12a8d
|
@ -29,8 +29,15 @@ class Operation:
|
||||||
return list(filter(lambda p: (p["in"] in types), self.parameters()))
|
return list(filter(lambda p: (p["in"] in types), self.parameters()))
|
||||||
|
|
||||||
def bodyRef(self):
|
def bodyRef(self):
|
||||||
|
# OpenAPI v3
|
||||||
if "requestBody" in self.props:
|
if "requestBody" in self.props:
|
||||||
return self.props["requestBody"]["content"]["application/json"]["schema"]["$ref"]
|
return self.props["requestBody"]["content"]["application/json"]["schema"]["$ref"]
|
||||||
|
# swagger v2
|
||||||
|
elif "parameters" in self.props:
|
||||||
|
inParameters = self.parametersForTypes(["body"])
|
||||||
|
if not isinstance(inParameters, list) or len(inParameters) < 1:
|
||||||
|
return None
|
||||||
|
return inParameters[0]["schema"]["$ref"]
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# header injection is not currently supported
|
# header injection is not currently supported
|
||||||
|
|
Loading…
Reference in New Issue
Block a user