From 8422b3c38a543cbc6f34e3902ca7d1883023bd04 Mon Sep 17 00:00:00 2001 From: Carlos Santos <4a.santos@gmail.com> Date: Fri, 28 Mar 2025 11:58:12 +0100 Subject: [PATCH] backend: Update recording stop response to include Location header with recording URL --- backend/openapi/openvidu-meet-api.yaml | 8 +++++++- backend/src/controllers/recording.controller.ts | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/backend/openapi/openvidu-meet-api.yaml b/backend/openapi/openvidu-meet-api.yaml index d3c0fcb..f25df1c 100644 --- a/backend/openapi/openvidu-meet-api.yaml +++ b/backend/openapi/openvidu-meet-api.yaml @@ -702,7 +702,13 @@ paths: example: 'room-123--EG_XYZ--XX445' responses: '200': - description: Successfully stopped the recording. + description: Accepted — The stop request has been accepted. The endpoint to retrieve the recording is provided in the Location header. + headers: + Location: + description: The URL to retrieve the recording details + schema: + type: string + example: 'https://openvidu.example.com/meet/api/v1/recordings/room-123--EG_XYZ--XX445' content: application/json: schema: diff --git a/backend/src/controllers/recording.controller.ts b/backend/src/controllers/recording.controller.ts index f8e7591..efe3d3a 100644 --- a/backend/src/controllers/recording.controller.ts +++ b/backend/src/controllers/recording.controller.ts @@ -94,6 +94,7 @@ export const stopRecording = async (req: Request, res: Response) => { const recordingService = container.get(RecordingService); const recordingInfo = await recordingService.stopRecording(recordingId); + res.setHeader('Location', `${req.protocol}://${req.get('host')}${req.originalUrl}`); return res.status(200).json(recordingInfo); } catch (error) { if (error instanceof OpenViduMeetError) {