Passing the custom request_data to the SmallWebRTCRunnerArguments body.

This commit is contained in:
Filipi Fuchter
2025-11-17 15:20:09 -03:00
parent 64417ef4ff
commit 0c3c26b7b8

View File

@@ -264,7 +264,10 @@ def _setup_webrtc_routes(
# Prepare runner arguments with the callback to run your bot # Prepare runner arguments with the callback to run your bot
async def webrtc_connection_callback(connection): async def webrtc_connection_callback(connection):
bot_module = _get_bot_module() bot_module = _get_bot_module()
runner_args = SmallWebRTCRunnerArguments(webrtc_connection=connection)
runner_args = SmallWebRTCRunnerArguments(
webrtc_connection=connection, body=request.request_data
)
background_tasks.add_task(bot_module.bot, runner_args) background_tasks.add_task(bot_module.bot, runner_args)
# Delegate handling to SmallWebRTCRequestHandler # Delegate handling to SmallWebRTCRequestHandler
@@ -326,7 +329,8 @@ def _setup_webrtc_routes(
type=request_data["type"], type=request_data["type"],
pc_id=request_data.get("pc_id"), pc_id=request_data.get("pc_id"),
restart_pc=request_data.get("restart_pc"), restart_pc=request_data.get("restart_pc"),
request_data=request_data, request_data=request_data.get("request_data")
or request_data.get("requestData"),
) )
return await offer(webrtc_request, background_tasks) return await offer(webrtc_request, background_tasks)
elif request.method == HTTPMethod.PATCH.value: elif request.method == HTTPMethod.PATCH.value: