Skip to content

Commit 9486c52

Browse files
committed
- Document params of Application.make_handler().
- Dropped hidden parameters, and the code example for `secure_proxy_ssl_header` according to code review notes.
1 parent dac1333 commit 9486c52

File tree

1 file changed

+33
-23
lines changed

1 file changed

+33
-23
lines changed

docs/web_reference.rst

+33-23
Original file line numberDiff line numberDiff line change
@@ -1136,38 +1136,48 @@ duplicated like one using :meth:`Application.copy`.
11361136

11371137
.. method:: make_handler(**kwargs)
11381138

1139-
Creates HTTP protocol factory for handling requests.
1139+
Creates HTTP protocol factory for handling requests.
11401140

1141-
:param kwargs: additional parameters for
1142-
:class:`~aiohttp.web.RequestHandlerFactory`
1143-
constructor.
1141+
:param tuple secure_proxy_ssl_header: Secure proxy SSL header. Can be used
1142+
to detect request scheme. Default: ``None``.
1143+
:param bool tcp_keepalive: Enable TCP Keep-Alive. Default: ``True``.
1144+
:param int keepalive_timeout: Number of seconds before closing Keep-Alive
1145+
connection. Default: ``75`` seconds (NGINX's default value).
1146+
:param slow_request_timeout: Slow request timeout. Default: ``0``.
1147+
:param logger: Custom logger object. Default:
1148+
:data:`aiohttp.log.server_logger`.
1149+
:param access_log: Custom logging object. Default:
1150+
:data:`aiohttp.log.access_logger`.
1151+
:param str access_log_format: Access log format string. Default:
1152+
:attr:`helpers.AccessLogger.LOG_FORMAT`.
1153+
:param bool debug: Switches debug mode. Default: ``False``.
11441154

1145-
.. deprecated:: 1.0
1146-
You should not pass ``debug`` parameter within ``kwargs`` since
1147-
its usage in :meth:`Application.make_handler` is deprecated in favor
1148-
of :attr:`Application.debug`.
1149-
The :class:`Application`'s debug mode setting should be used
1150-
as a single point to setup a debug mode.
1155+
.. deprecated:: 1.0
11511156

1152-
You should pass result of the method as *protocol_factory* to
1153-
:meth:`~asyncio.AbstractEventLoop.create_server`, e.g.::
1157+
The usage of ``debug`` parameter in :meth:`Application.make_handler`
1158+
is deprecated in favor of :attr:`Application.debug`.
1159+
The :class:`Application`'s debug mode setting should be used
1160+
as a single point to setup a debug mode.
11541161

1155-
loop = asyncio.get_event_loop()
1162+
:param int max_line_size: Optional maximum header line size. Default:
1163+
``8190``.
1164+
:param int max_headers: Optional maximum header size. Default: ``32768``.
1165+
:param int max_field_size: Optional maximum header field size. Default:
1166+
``8190``.
11561167

1157-
app = Application(loop=loop)
11581168

1159-
# setup route table
1160-
# app.router.add_route(...)
1169+
You should pass result of the method as *protocol_factory* to
1170+
:meth:`~asyncio.AbstractEventLoop.create_server`, e.g.::
11611171

1162-
await loop.create_server(app.make_handler(),
1163-
'0.0.0.0', 8080)
1172+
loop = asyncio.get_event_loop()
11641173

1165-
``secure_proxy_ssl_header`` keyword parameter
1166-
can be used to detect request scheme::
1174+
app = Application(loop=loop)
11671175

1168-
await loop.create_server(app.make_handler(
1169-
secure_proxy_ssl_header='X-Forwarded-Proto'),
1170-
'0.0.0.0', 8080)
1176+
# setup route table
1177+
# app.router.add_route(...)
1178+
1179+
await loop.create_server(app.make_handler(),
1180+
'0.0.0.0', 8080)
11711181

11721182
.. coroutinemethod:: startup()
11731183

0 commit comments

Comments
 (0)