MCPcopy Create free account
hub / github.com/sqlmapproject/sqlmap / _body

Method _body

thirdparty/bottle/bottle.py:1722–1747  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1720
1721 @DictProperty('environ', 'bottle.request.body', read_only=True)
1722 def _body(self):
1723 mp_markup = None
1724 mp_boundary_match = MULTIPART_BOUNDARY_PATT.match(self.environ.get('CONTENT_TYPE', ''))
1725 if mp_boundary_match is not None:
1726 mp_markup = MPBodyMarkup(tob(mp_boundary_match.group(1)))
1727 try:
1728 read_func = self.environ['wsgi.input'].read
1729 except KeyError:
1730 self.environ['wsgi.input'] = BytesIO()
1731 return self.environ['wsgi.input']
1732 body_iter = self._iter_chunked if self.chunked else self._iter_body
1733 body, body_size, is_temp_file = BytesIO(), 0, False
1734 for part in body_iter(read_func, self.MEMFILE_MAX):
1735 body.write(part)
1736 if mp_markup is not None:
1737 mp_markup.parse(part)
1738 body_size += len(part)
1739 if not is_temp_file and body_size > self.MEMFILE_MAX:
1740 body, tmp = NamedTemporaryFile(mode='w+b'), body
1741 body.write(tmp.getvalue())
1742 del tmp
1743 is_temp_file = True
1744 body.multipart_markup = mp_markup
1745 self.environ['wsgi.input'] = body
1746 body.seek(0)
1747 return body
1748
1749 def _get_body_string(self, maxread):
1750 """ Read body into a string. Raise HTTPError(413) on requests that are

Callers

nothing calls this directly

Calls 7

parseMethod · 0.95
MPBodyMarkupClass · 0.85
tobFunction · 0.85
matchMethod · 0.45
getMethod · 0.45
writeMethod · 0.45
seekMethod · 0.45

Tested by

no test coverage detected