Closed kristjanvalur closed 1 year ago
Yes, extra keys in events and the scope are generally permitted, much like in WSGI - the spec defines what values must be present, rather than the entire schema of the dictionary. ASGI specs will jump minor versions (e.g. 2.0 -> 2.1) when new fields are added like that, and major versions (e.g. 1.0 -> 2.0) when fields/keys are either removed or their meaning in changed in a backwards-incompatible way.
It isn't clear from reading the spec, but are extra fields in events allowed? For example, the
headers
field was added towebsocket.accept
in revision 2.1. Is an application allowed to set such headers, before first checking thespec_version
from thescope
?