MCPcopy
hub / github.com/aio-libs/aiohttp / __call__

Method __call__

aiohttp/protocol.py:145–159  ·  view source on GitHub ↗
(self, out, buf)

Source from the content-addressed store, hash-verified

143 self.allowed_methods = [m.upper() for m in allowed_methods]
144
145 def __call__(self, out, buf):
146 raw_data = yield from buf.waituntil(b' ', 12)
147 method = raw_data.decode('ascii', 'surrogateescape').strip()
148
149 # method
150 method = method.upper()
151 if not METHRE.match(method):
152 raise errors.BadStatusLine(method)
153
154 # allowed method
155 if self.allowed_methods and method not in self.allowed_methods:
156 raise errors.HttpMethodNotAllowed(message=method)
157
158 out.feed_data(method, len(method))
159 out.feed_eof()
160
161
162class HttpRequestParser(HttpParser):

Callers

nothing calls this directly

Calls 5

waituntilMethod · 0.80
decodeMethod · 0.80
matchMethod · 0.45
feed_dataMethod · 0.45
feed_eofMethod · 0.45

Tested by

no test coverage detected