Skip to content

Commit ef7b1e3

Browse files
committed
Proof-read upgrade guide.
1 parent 566ab1d commit ef7b1e3

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

docs/howto/upgrade.rst

+16-16
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ It provides a very similar API. However, there are a few differences.
1010

1111
The recommended upgrade process is:
1212

13-
#. Make sure that your application doesn't use any `deprecated APIs`_. If it
14-
doesn't raise any warnings, you can skip this step.
15-
#. `Update import paths`_. For straightforward usage of websockets, this could
16-
be the only step you need to take. Upgrading could be transparent.
17-
#. Check out `new features and improvements`_ and consider taking advantage of
18-
them to improve your application.
19-
#. Review `API changes`_ and adapt your application to preserve its current
20-
functionality.
13+
#. Make sure that your code doesn't use any `deprecated APIs`_. If it doesn't
14+
raise warnings, you're fine.
15+
#. `Update import paths`_. For straightforward use cases, this could be the only
16+
step you need to take.
17+
#. Check out `new features and improvements`_. Consider taking advantage of them
18+
in your code.
19+
#. Review `API changes`_. If needed, update your application to preserve its
20+
current behavior.
2121

2222
In the interest of brevity, only :func:`~asyncio.client.connect` and
2323
:func:`~asyncio.server.serve` are discussed below but everything also applies
@@ -146,9 +146,8 @@ Customizing the opening handshake
146146
.................................
147147

148148
On the server side, if you're customizing how :func:`~legacy.server.serve`
149-
processes the opening handshake with the ``process_request``, ``extra_headers``,
150-
or ``select_subprotocol``, you must update your code and you can probably make
151-
it simpler.
149+
processes the opening handshake with ``process_request``, ``extra_headers``, or
150+
``select_subprotocol``, you must update your code. Probably you can simplify it!
152151

153152
``process_request`` and ``select_subprotocol`` have new signatures.
154153
``process_response`` replaces ``extra_headers`` and provides more flexibility.
@@ -481,16 +480,17 @@ a ``check_credentials`` coroutine as well as an optional ``realm`` just like
481480
This new API has more obvious semantics. That makes it easier to understand and
482481
also easier to extend.
483482

484-
In the original implementation, overriding ``create_protocol`` changed the type
483+
In the original implementation, overriding ``create_protocol`` changes the type
485484
of connection objects to :class:`~legacy.auth.BasicAuthWebSocketServerProtocol`,
486485
a subclass of :class:`~legacy.server.WebSocketServerProtocol` that performs HTTP
487-
Basic Authentication in its ``process_request`` method. If you wanted to
488-
customize ``process_request`` further, you had:
486+
Basic Authentication in its ``process_request`` method.
489487

490-
* an ill-defined option: add a ``process_request`` argument to
488+
To customize ``process_request`` further, you had only bad options:
489+
490+
* the ill-defined option: add a ``process_request`` argument to
491491
:func:`~legacy.server.serve`; to tell which one would run first, you had to
492492
experiment or read the code;
493-
* a cumbersome option: subclass
493+
* the cumbersome option: subclass
494494
:class:`~legacy.auth.BasicAuthWebSocketServerProtocol`, then pass that
495495
subclass in the ``create_protocol`` argument of
496496
:func:`~legacy.auth.basic_auth_protocol_factory`.

0 commit comments

Comments
 (0)