From 50f0b98d43a71d37f478de75f45abfb315883cf6 Mon Sep 17 00:00:00 2001 From: Maik Hoepfel Date: Fri, 28 Apr 2017 23:44:05 +0200 Subject: [PATCH] Two minor spec changes (#625) * Remove mention of fixed reply channel name Per the recent changes, the reply channel name is now at the discretion of the server. * Clarification on bytes/text values being empty This commit clarifies that the bytes/text values need to be non-empty (so not None/'') for them to be treated as present. * HTTP Response headers are optional During discussion with Andrew, we noted that they are optional, and that that makes good sense. So this commit updates the spec to reflect reality. --- docs/asgi/www.rst | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/asgi/www.rst b/docs/asgi/www.rst index cc5c2d5..f0a9f55 100644 --- a/docs/asgi/www.rst +++ b/docs/asgi/www.rst @@ -49,8 +49,7 @@ Channel: ``http.request`` Keys: -* ``reply_channel``: Channel name for responses and server pushes, starting with - ``http.response!`` +* ``reply_channel``: Channel name for responses and server pushes. * ``http_version``: Unicode string, one of ``1.0``, ``1.1`` or ``2``. @@ -137,7 +136,7 @@ Keys: * ``headers``: A list of ``[name, value]`` lists, where ``name`` is the byte string header name, and ``value`` is the byte string header value. Order must be preserved in the HTTP response. Header names - must be lowercased. + must be lowercased. Optional, defaults to an empty list. * ``content``: Byte string of HTTP body content. Optional, defaults to empty string. @@ -357,13 +356,14 @@ message: * If ``accept`` is ``True``, accept the connection (and send any data provided). * If ``accept`` is ``False``, reject the connection and do nothing else. If ``bytes`` or ``text`` were also present they must be ignored. -* If ``bytes`` or ``text`` is present, accept the connection and send the data. +* If ``bytes`` or ``text`` is present and contains a non-empty value, + accept the connection and send the data. * If ``close`` is ``True`` or a positive integer, reject the connection. If - ``bytes`` or ``text`` is also set, it should accept the connection, send the - frame, then immediately close the connection. Note that any close code integer - sent is ignored, as connections are rejected with HTTP's ``403 Forbidden``, - unless data is also sent, in which case a full WebSocket close is done with - the provided code. + ``bytes`` or ``text`` is also set and not empty, it should accept the + connection, send the frame, then immediately close the connection. + Note that any close code integer sent is ignored, as connections are + rejected with HTTP's ``403 Forbidden``, unless data is also sent, in which + case a full WebSocket close is done with the provided code. If received while the connection is established: