Skip to content

Commit

Permalink
Really try to clarify this spec version stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewgodwin committed Mar 1, 2019
1 parent cb459f8 commit 55e9ac4
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions specs/www.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,21 @@ and specifies how to translate between the two for the set of requests that
are able to be handled by WSGI.


Spec Versions
-------------

This spec has had two versions:

* ``2.0``: The first version of the spec, released with ASGI 2.0
* ``2.1``: Added the ``headers`` key to the WebSocket Accept response.

Spec versions let you understand what the server you are using understands -
if a server tells you it only supports version ``2.0`` of this spec, then
sending ``headers`` with a WebSocket Accept message is an error, for example.

They are separate from the HTTP version or the ASGI version.


HTTP
----

Expand Down Expand Up @@ -53,8 +68,8 @@ The connection scope contains:

* ``type``: ``http``

* ``asgi['spec_version']``: Version of the spec as a string, must be ``1.0``.
Optional, if missing assume ``1.0``.
* ``asgi['spec_version']``: Version of the ASGI HTTP spec this server understands
as a string; one of ``2.0`` or ``2.1``. Optional, if missing assume ``2.0``.

* ``http_version``: Unicode string, one of ``1.0``, ``1.1`` or ``2``.

Expand Down Expand Up @@ -192,8 +207,8 @@ contains the initial connection metadata (mostly from the HTTP handshake):

* ``type``: ``websocket``

* ``asgi['spec_version']``: Version of the spec as a string, one of ``1.0`` or ``2.0``.
Optional, if missing assume ``1.0``.
* ``asgi['spec_version']``: Version of the ASGI HTTP spec this server understands
as a string; one of ``2.0`` or ``2.1``. Optional, if missing assume ``2.0``.

* ``http_version``: Unicode string, one of ``1.1`` or ``2``. Optional,
default is ``1.1``.
Expand Down

2 comments on commit 55e9ac4

@pgjones
Copy link
Contributor

@pgjones pgjones commented on 55e9ac4 Mar 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andrewgodwin should there also be a spec version for the lifespan protocol?

@andrewgodwin
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pgjones Totally - see #80, where I've added that in and bumped it with Tom's proposed changes.

Please sign in to comment.