Skip to content

Commit 5add713

Browse files
authored
fix CloudEvent raw http response (#47)
add missing await
1 parent 4c757fa commit 5add713

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
1616
### Deprecated
1717
### Removed
1818
### Fixed
19+
20+
- Fixed CloudEvent raw http send (missing await)
21+
1922
### Security
2023

2124
## [0.4] - 2025-03-02

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ Install dependencies:
2828
Run suite:
2929
`poetry run pytest`
3030

31+
Or more verbosely:
32+
`poetry run pytest -vs --log-cli-level=INFO`
33+
3134
To enable more granular log levels:
3235
`poetry run pytest --log-cli-level=INFO`
3336

src/func_python/cloudevent.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ async def handle(self, scope, receive, send):
4747

4848

4949
class ASGIApplication():
50+
""" ASGIApplication is a wrapper around a Function instance which
51+
exposes it as an ASGI Application.
52+
"""
5053
def __init__(self, f):
5154
self.f = f
5255
self.stop_event = asyncio.Event()
@@ -257,7 +260,7 @@ async def binary(self, event, status=200):
257260
async def http(self, message):
258261
"""Send a raw http response, bypassing the automatic cloudevent
259262
encoding. Use this for more granular control of the response."""
260-
self._send(message)
263+
await self._send(message)
261264

262265
async def _send_encoded_cloudevent(self, headers, body, status=200):
263266
"""Send the given cloudevent headers and body."""

0 commit comments

Comments
 (0)