@@ -1453,13 +1453,19 @@ def do_GET(self):
14531453 request_path , _ , query = self .path .partition ("?" )
14541454 if request_path == _bolt_oauth_flow .install_path :
14551455 bolt_req = BoltRequest (
1456- body = "" , query = query , headers = self .headers
1456+ body = "" ,
1457+ query = query ,
1458+ # email.message.Message's mapping interface is dict compatible
1459+ headers = self .headers , # type:ignore
14571460 )
14581461 bolt_resp = _bolt_oauth_flow .handle_installation (bolt_req )
14591462 self ._send_bolt_response (bolt_resp )
14601463 elif request_path == _bolt_oauth_flow .redirect_uri_path :
14611464 bolt_req = BoltRequest (
1462- body = "" , query = query , headers = self .headers
1465+ body = "" ,
1466+ query = query ,
1467+ # email.message.Message's mapping interface is dict compatible
1468+ headers = self .headers , # type:ignore
14631469 )
14641470 bolt_resp = _bolt_oauth_flow .handle_callback (bolt_req )
14651471 self ._send_bolt_response (bolt_resp )
@@ -1477,7 +1483,10 @@ def do_POST(self):
14771483 len_header = self .headers .get ("Content-Length" ) or 0
14781484 request_body = self .rfile .read (int (len_header )).decode ("utf-8" )
14791485 bolt_req = BoltRequest (
1480- body = request_body , query = query , headers = self .headers
1486+ body = request_body ,
1487+ query = query ,
1488+ # email.message.Message's mapping interface is dict compatible
1489+ headers = self .headers , # type:ignore
14811490 )
14821491 bolt_resp : BoltResponse = _bolt_app .dispatch (bolt_req )
14831492 self ._send_bolt_response (bolt_resp )
@@ -1503,7 +1512,7 @@ def _send_response(
15031512 for k , vs in headers .items ():
15041513 for v in vs :
15051514 self .send_header (k , v )
1506- self .send_header ("Content-Length" , len (body_bytes ))
1515+ self .send_header ("Content-Length" , str ( len (body_bytes ) ))
15071516 self .end_headers ()
15081517 self .wfile .write (body_bytes )
15091518
0 commit comments