Skip to content

Commit b8c13d4

Browse files
authored
fix(falcon/async_resource): replace the use of removed resp.body
1 parent e8222b5 commit b8c13d4

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

slack_bolt/adapter/falcon/async_resource.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from datetime import datetime
22
from http import HTTPStatus
33

4+
from falcon import MEDIA_TEXT
45
from falcon import version as falcon_version
56
from falcon.asgi import Request, Response
67
from slack_bolt import BoltResponse
@@ -40,9 +41,9 @@ async def on_get(self, req: Request, resp: Response):
4041
await self._write_response(bolt_resp, resp)
4142
return
4243

43-
resp.status = "404"
44-
# Falcon 4.x w/ mypy fails to correctly infer the str type here
45-
resp.body = "The page is not found..."
44+
resp.status = HTTPStatus.NOT_FOUND
45+
resp.content_type = MEDIA_TEXT
46+
resp.text = "The page is not found..."
4647

4748
async def on_post(self, req: Request, resp: Response):
4849
bolt_req = await self._to_bolt_request(req)

0 commit comments

Comments
 (0)