backend: Update recording stop response to include Location header with recording URL

This commit is contained in:
Carlos Santos 2025-03-28 11:58:12 +01:00
parent 578a3fec50
commit 8422b3c38a
2 changed files with 8 additions and 1 deletions

View File

@ -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:

View File

@ -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) {