mirror of
https://github.com/django/daphne.git
synced 2025-07-30 00:49:44 +03:00
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.
This commit is contained in:
parent
004b34c67d
commit
50f0b98d43
|
@ -49,8 +49,7 @@ Channel: ``http.request``
|
||||||
|
|
||||||
Keys:
|
Keys:
|
||||||
|
|
||||||
* ``reply_channel``: Channel name for responses and server pushes, starting with
|
* ``reply_channel``: Channel name for responses and server pushes.
|
||||||
``http.response!``
|
|
||||||
|
|
||||||
* ``http_version``: Unicode string, one of ``1.0``, ``1.1`` or ``2``.
|
* ``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
|
* ``headers``: A list of ``[name, value]`` lists, where ``name`` is the
|
||||||
byte string header name, and ``value`` is the byte string
|
byte string header name, and ``value`` is the byte string
|
||||||
header value. Order must be preserved in the HTTP response. Header names
|
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.
|
* ``content``: Byte string of HTTP body content.
|
||||||
Optional, defaults to empty string.
|
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 ``True``, accept the connection (and send any data provided).
|
||||||
* If ``accept`` is ``False``, reject the connection and do nothing else.
|
* 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`` 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
|
* 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
|
``bytes`` or ``text`` is also set and not empty, it should accept the
|
||||||
frame, then immediately close the connection. Note that any close code integer
|
connection, send the frame, then immediately close the connection.
|
||||||
sent is ignored, as connections are rejected with HTTP's ``403 Forbidden``,
|
Note that any close code integer sent is ignored, as connections are
|
||||||
unless data is also sent, in which case a full WebSocket close is done with
|
rejected with HTTP's ``403 Forbidden``, unless data is also sent, in which
|
||||||
the provided code.
|
case a full WebSocket close is done with the provided code.
|
||||||
|
|
||||||
If received while the connection is established:
|
If received while the connection is established:
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user