emmett-framework / granian

A Rust HTTP server for Python applications
BSD 3-Clause "New" or "Revised" License
2.86k stars 83 forks source link

1.6.2 websockets access logs broken #423

Closed brycedrennan closed 2 weeks ago

brycedrennan commented 2 weeks ago
web-1  | [ERROR] Application callable raised an exception
web-1  | Traceback (most recent call last):
web-1  |   File "/usr/local/lib/python3.12/site-packages/granian/_futures.py", line 4, in future_watcher
web-1  |     await inner(watcher.scope, watcher.proto)
web-1  |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
web-1  |   File "/usr/local/lib/python3.12/site-packages/granian/asgi.py", line 130, in _logger
web-1  |     return _ws_logger(scope, proto)
web-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^
web-1  |   File "/usr/local/lib/python3.12/site-packages/granian/asgi.py", line 124, in _ws_logger
web-1  |     access_log(time.time(), scope, 101)
web-1  |   File "/usr/local/lib/python3.12/site-packages/granian/asgi.py", line 150, in access_log
web-1  |     'method': scope['method'],
web-1  |               ~~~~~^^^^^^^^^^
web-1  | KeyError: 'method'
brycedrennan commented 2 weeks ago

Maybe related to https://github.com/emmett-framework/granian/pull/420