You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
A description of what the bug is, possibly including how to reproduce it.
2024-07-14 01:01:14,382-14-ERROR-Unhandled exception - "POST /wechat?signature=8fa7d50f1cac4556336b1b64386df3e49cb48fde×tamp=1720918873&nonce=2147035210&openid=omaqTs24GgB2wEINZwL0Ybo5pXtg&encrypt_type=aes&msg_signature=217f303f3391d560c77277df82f4e96f71eabd72"
Traceback (most recent call last):
File "blacksheep/baseapp.pyx", line 81, in blacksheep.baseapp.BaseApplication.handle
File "/usr/local/lib/python3.12/site-packages/blacksheep/middlewares.py", line 6, in middleware_wrapper
return await handler(request, next_handler)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/blacksheep/sessions/init.py", line 156, in call
response = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/blacksheep/middlewares.py", line 6, in middleware_wrapper
return await handler(request, next_handler)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/blacksheep/server/authentication/init.py", line 19, in authentication_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/blacksheep/middlewares.py", line 6, in middleware_wrapper
return await handler(request, next_handler)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/blacksheep/server/authorization/init.py", line 82, in authorization_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/blacksheep/middlewares.py", line 6, in middleware_wrapper
return await handler(request, next_handler)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/blacksheep/server/compression.py", line 106, in call
if not self.should_handle(request, response):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/blacksheep/server/compression.py", line 96, in should_handle
return is_handled_encoding() and is_handled_response_content()
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/blacksheep/server/compression.py", line 78, in is_handled_encoding
return b"gzip" in (request.get_first_header(b"accept-encoding") or "")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'in ' requires string as left operand, not bytes
The text was updated successfully, but these errors were encountered:
bymoye
added a commit
to bymoye/BlackSheep
that referenced
this issue
Jul 29, 2024
It seems that the problem lies in the lack of accept-encoding header, which causes it to take the empty string on the right by default, but the left side is bytes, which causes the problem.
Describe the bug
A description of what the bug is, possibly including how to reproduce it.
2024-07-14 01:01:14,382-14-ERROR-Unhandled exception - "POST /wechat?signature=8fa7d50f1cac4556336b1b64386df3e49cb48fde×tamp=1720918873&nonce=2147035210&openid=omaqTs24GgB2wEINZwL0Ybo5pXtg&encrypt_type=aes&msg_signature=217f303f3391d560c77277df82f4e96f71eabd72"
Traceback (most recent call last):
File "blacksheep/baseapp.pyx", line 81, in blacksheep.baseapp.BaseApplication.handle
File "/usr/local/lib/python3.12/site-packages/blacksheep/middlewares.py", line 6, in middleware_wrapper
return await handler(request, next_handler)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/blacksheep/sessions/init.py", line 156, in call
response = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/blacksheep/middlewares.py", line 6, in middleware_wrapper
return await handler(request, next_handler)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/blacksheep/server/authentication/init.py", line 19, in authentication_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/blacksheep/middlewares.py", line 6, in middleware_wrapper
return await handler(request, next_handler)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/blacksheep/server/authorization/init.py", line 82, in authorization_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/blacksheep/middlewares.py", line 6, in middleware_wrapper
return await handler(request, next_handler)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/blacksheep/server/compression.py", line 106, in call
if not self.should_handle(request, response):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/blacksheep/server/compression.py", line 96, in should_handle
return is_handled_encoding() and is_handled_response_content()
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/blacksheep/server/compression.py", line 78, in is_handled_encoding
return b"gzip" in (request.get_first_header(b"accept-encoding") or "")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'in ' requires string as left operand, not bytes
The text was updated successfully, but these errors were encountered: