aiogram/CHANGES/1664.bugfix.rst
2025-04-05 20:31:42 +03:00

25 lines
551 B
ReStructuredText
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Fix empty response into webhook.
We need to return something “empty”, and “empty” form doesnt work since
its sending only “end” boundary w/o “start”.
An empty formdata should look smth like this for Telegram to understand:
::
--webhookBoundaryvsF_aMHhspPjfOq7O0JNRg
--webhookBoundaryvsF_aMHhspPjfOq7O0JNRg--
But aiohttp sends only the ending boundary:
::
--webhookBoundaryvsF_aMHhspPjfOq7O0JNRg--
Such response doesn't suit Telegram servers.
The fix replaces empty response with empty JSON response:
::
{}