Skip to content

Commit

Permalink
Add ASGI versioning to the scope definition (#60)
Browse files Browse the repository at this point in the history
This allows frameworks to know what version of the ASGI specification
the server implements. This in turn allows features to be added to the
specification for framework usage.
  • Loading branch information
pgjones authored and andrewgodwin committed Aug 26, 2018
1 parent 5876092 commit 3814f65
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions specs/asgi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,14 @@ The application interface is specified as the more generic case of two callables
to allow more flexibility for things like factory functions or type-based
dispatchers.

Both the ``scope`` and the format of the messages you send and receive are
defined by one of the application protocols. ``scope`` must be a ``dict``.
The key ``scope["type"]`` will always be present, and can be used to work
out which protocol is incoming.
Both the ``scope`` and the format of the messages you send and receive
are defined by one of the application protocols. ``scope`` must be a
``dict``. The key ``scope["type"]`` will always be present, and can
be used to work out which protocol is incoming. The key
``scope["asgi"]`` will also be present as a dictionary containing a
``scope["asgi"]["version"]`` key that corresponds to the ASGI version
the server implements. If missing the version should default to
``"2.0"``.

The protocol-specific sub-specifications cover these scope
and message formats. They are equivalent to the specification for keys in the
Expand Down

0 comments on commit 3814f65

Please sign in to comment.