Skip to content

Commit

Permalink
Add spec versioning to HTTP/WebSocket
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewgodwin committed Feb 23, 2019
1 parent 7f89bd6 commit 6269216
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion specs/www.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ The connection scope contains:

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

* ``spec_version``: Version of the spec as a string, must be ``1.0``.

This comment has been minimized.

Copy link
@tomchristie

tomchristie Feb 26, 2019

Member

"Version of the of the spec" Of which spec?

Optional, if missing assume ``1.0``.

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

* ``method``: Unicode string HTTP method name, uppercased.
Expand Down Expand Up @@ -189,6 +192,9 @@ contains the initial connection metadata (mostly from the HTTP handshake):

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

* ``spec_version``: Version of the spec as a string, one of ``1.0`` or ``2.0``.
Optional, if missing assume ``1.0``.

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

Expand Down Expand Up @@ -257,7 +263,7 @@ Sent by the application when it wishes to accept an incoming connection.
value. Order must be preserved in the HTTP response. Header names
must be lowercased. Must not include a ``sec-websocket-protocol``
named header, use the ``subprotocol`` key instead. Optional,
defaults to an empty list.
defaults to an empty list. *Added in spec version 2.0*

This comment has been minimized.

Copy link
@pgjones

pgjones Mar 3, 2019

Contributor

@andrewgodwin I think this should be 2.1 now, unless I'm confused?

This comment has been minimized.

Copy link
@andrewgodwin

andrewgodwin Mar 4, 2019

Author Member

Right, yes. Remind me to do this as a pull request next time,



Receive
Expand Down

6 comments on commit 6269216

@pgjones
Copy link
Contributor

Choose a reason for hiding this comment

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

@andrewgodwin The scope currently has "asgi": {"version": "2.0"} which was chosen to allow for additional meta data. Should this follow-on with "spec": {"version": "1.0"} (or specification)?

@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 True, maybe instead it should be "asgi": {"version": "2.0", "spec_version": "2.0"}?

@pgjones
Copy link
Contributor

Choose a reason for hiding this comment

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

Yep, that looks good to me.

@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.

I'll fix it up then.

@tomchristie
Copy link
Member

Choose a reason for hiding this comment

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

As it stands I think this might need a bit more clarity.
It's not first-sight obvious to me without some careful parsing how to interpret version, spec_version, http_version.

@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.

I'll clarify it more.

Please sign in to comment.