Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added asgi version and spec_version to scope #597

Merged
merged 10 commits into from
May 4, 2020
2 changes: 1 addition & 1 deletion tests/test_main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import asyncio
import threading
import time
import asyncio

import requests

Expand Down
1 change: 1 addition & 0 deletions uvicorn/protocols/http/h11_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ def handle_events(self):
raw_path, _, query_string = event.target.partition(b"?")
self.scope = {
"type": "http",
"asgi": {"version": "2.1", "spec_version": "2.1"},
florimondmanca marked this conversation as resolved.
Show resolved Hide resolved
"http_version": event.http_version.decode("ascii"),
"server": self.server,
"client": self.client,
Expand Down
1 change: 1 addition & 0 deletions uvicorn/protocols/http/httptools_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ def on_url(self, url):
self.headers = []
self.scope = {
"type": "http",
"asgi": {"version": "2.1", "spec_version": "2.1"},
"http_version": "1.1",
"server": self.server,
"client": self.client,
Expand Down
1 change: 1 addition & 0 deletions uvicorn/protocols/websockets/websockets_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ async def process_request(self, path, headers):

self.scope = {
"type": "websocket",
"asgi": {"version": "2.1", "spec_version": "2.1"},
"scheme": self.scheme,
"server": self.server,
"client": self.client,
Expand Down
1 change: 1 addition & 0 deletions uvicorn/protocols/websockets/wsproto_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ def handle_connect(self, event):
raw_path, _, query_string = event.target.partition("?")
self.scope = {
"type": "websocket",
"asgi": {"version": "2.1", "spec_version": "2.1"},
"http_version": "1.1",
"scheme": self.scheme,
"server": self.server,
Expand Down