backend: update recording URLs to include the host in responses
This commit is contained in:
parent
067583951f
commit
ada76e5c2a
@ -20,7 +20,7 @@ export const startRecording = async (req: Request, res: Response) => {
|
|||||||
const recordingInfo = await recordingService.startRecording(roomId);
|
const recordingInfo = await recordingService.startRecording(roomId);
|
||||||
res.setHeader(
|
res.setHeader(
|
||||||
'Location',
|
'Location',
|
||||||
`${req.protocol}://${req.get('host')}/${INTERNAL_CONFIG.INTERNAL_API_BASE_PATH_V1}/recordings/${recordingInfo.recordingId}`
|
`${req.protocol}://${req.get('host')}${INTERNAL_CONFIG.INTERNAL_API_BASE_PATH_V1}/recordings/${recordingInfo.recordingId}`
|
||||||
);
|
);
|
||||||
|
|
||||||
return res.status(201).json(recordingInfo);
|
return res.status(201).json(recordingInfo);
|
||||||
@ -112,7 +112,10 @@ export const stopRecording = async (req: Request, res: Response) => {
|
|||||||
const recordingService = container.get(RecordingService);
|
const recordingService = container.get(RecordingService);
|
||||||
|
|
||||||
const recordingInfo = await recordingService.stopRecording(recordingId);
|
const recordingInfo = await recordingService.stopRecording(recordingId);
|
||||||
res.setHeader('Location', `${req.protocol}://${req.get('host')}${req.originalUrl}`);
|
res.setHeader(
|
||||||
|
'Location',
|
||||||
|
`${req.protocol}://${req.get('host')}${INTERNAL_CONFIG.INTERNAL_API_BASE_PATH_V1}/recordings/${recordingId}`
|
||||||
|
);
|
||||||
return res.status(202).json(recordingInfo);
|
return res.status(202).json(recordingInfo);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(res, error, `stopping recording '${recordingId}'`);
|
handleError(res, error, `stopping recording '${recordingId}'`);
|
||||||
@ -236,7 +239,7 @@ export const getRecordingUrl = async (req: Request, res: Response) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const secret = privateAccess ? recordingSecrets.privateAccessSecret : recordingSecrets.publicAccessSecret;
|
const secret = privateAccess ? recordingSecrets.privateAccessSecret : recordingSecrets.publicAccessSecret;
|
||||||
const recordingUrl = `${INTERNAL_CONFIG.API_BASE_PATH_V1}/recordings/${recordingId}/media?secret=${secret}`;
|
const recordingUrl = `${req.protocol}://${req.get('host')}${INTERNAL_CONFIG.API_BASE_PATH_V1}/recordings/${recordingId}/media?secret=${secret}`;
|
||||||
|
|
||||||
return res.status(200).json({ url: recordingUrl });
|
return res.status(200).json({ url: recordingUrl });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user