mirror of
https://github.com/sqlmapproject/sqlmap
synced 2025-12-07 08:52:20 +01:00
support for swagger v2 body specs
This commit is contained in:
parent
35cb10fd69
commit
051eb12a8d
1 changed files with 7 additions and 0 deletions
|
|
@ -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 a new issue