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

fix aiohttp disconnect error on websockets #2806

Merged
merged 1 commit into from
Oct 29, 2024
Merged

Conversation

s22chan
Copy link
Contributor

@s22chan s22chan commented Oct 27, 2024

aiohttp will throw if the handler doesn't return anything.

14:11:35 aiohttp ERRO Missing return statement on request handler
Traceback (most recent call last):
  File "/Users/steve/conda/envs/port/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 653, in finish_response
    prepare_meth = resp.prepare
                   ^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'prepare'

Fixes #2805

https://docs.aiohttp.org/en/stable/web_quickstart.html#websockets

Pull Request Checklist

  • Description which clearly states what problems the PR solves.
  • Description contains a link to the Github Issue, and any relevent
    Discussions, this PR applies to.
  • Include new tests that fail without this PR but passes with it.
  • Include any relevent Documentation changes related to this change.
  • Verify all commits have been signed in accordance with the DCO policy.
  • Reviewed PR commit history to remove unnecessary changes.
  • Make sure your PR passes build, test and lint steps completely.

aiohttp will throw if the handler doesn't return anything.

```python
14:11:35 aiohttp ERRO Missing return statement on request handler
Traceback (most recent call last):
  File "/Users/steve/conda/envs/port/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 653, in finish_response
    prepare_meth = resp.prepare
                   ^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'prepare'
```

https://docs.aiohttp.org/en/stable/web_quickstart.html#websockets
Signed-off-by: Steve Chan <s22chan@hotmail.com>
@texodus texodus added the bug Concrete, reproducible bugs label Oct 29, 2024
Copy link
Member

@texodus texodus left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Looks good!

@texodus texodus merged commit 09204c5 into finos:master Oct 29, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Concrete, reproducible bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aiohttp handler: 'NoneType' object has no attribute 'prepare'
2 participants