Skip to content

Commit 495e8e7

Browse files
committed
Correct Content-Length to be valid even for non-ascii content
1 parent 02ea23a commit 495e8e7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

slack_bolt/oauth/internals.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def _build_callback_success_response( # type: ignore
3535
status=200,
3636
headers={
3737
"Content-Type": "text/html; charset=utf-8",
38-
"Content-Length": len(html),
38+
"Content-Length": len(bytes(html, "utf-8")),
3939
"Set-Cookie": self._state_utils.build_set_cookie_for_deletion(),
4040
},
4141
body=html,
@@ -59,7 +59,7 @@ def _build_callback_failure_response( # type: ignore
5959
status=status,
6060
headers={
6161
"Content-Type": "text/html; charset=utf-8",
62-
"Content-Length": len(html),
62+
"Content-Length": len(bytes(html, "utf-8")),
6363
"Set-Cookie": self._state_utils.build_set_cookie_for_deletion(),
6464
},
6565
body=html,

0 commit comments

Comments
 (0)