mirror of https://github.com/OpenVidu/openvidu.git
openvidu-server: return 501 for any recording REST method if recording disabled
parent
5f258daf80
commit
71c5409b05
|
@ -598,6 +598,11 @@ public class SessionRestController {
|
|||
|
||||
log.info("REST API: POST /api/recordings/stop/{}", recordingId);
|
||||
|
||||
if (!this.openviduConfig.isRecordingModuleEnabled()) {
|
||||
// OpenVidu Server configuration property "OPENVIDU_RECORDING" is set to false
|
||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
Recording recording = recordingManager.getStartedRecording(recordingId);
|
||||
|
||||
if (recording == null) {
|
||||
|
@ -634,6 +639,11 @@ public class SessionRestController {
|
|||
|
||||
log.info("REST API: GET /api/recordings/{}", recordingId);
|
||||
|
||||
if (!this.openviduConfig.isRecordingModuleEnabled()) {
|
||||
// OpenVidu Server configuration property "OPENVIDU_RECORDING" is set to false
|
||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
try {
|
||||
Recording recording = this.recordingManager.getRecording(recordingId);
|
||||
if (io.openvidu.java.client.Recording.Status.started.equals(recording.getStatus())
|
||||
|
@ -651,6 +661,11 @@ public class SessionRestController {
|
|||
|
||||
log.info("REST API: GET /api/recordings");
|
||||
|
||||
if (!this.openviduConfig.isRecordingModuleEnabled()) {
|
||||
// OpenVidu Server configuration property "OPENVIDU_RECORDING" is set to false
|
||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
Collection<Recording> recordings = this.recordingManager.getAllRecordings();
|
||||
JsonObject json = new JsonObject();
|
||||
JsonArray jsonArray = new JsonArray();
|
||||
|
@ -671,6 +686,11 @@ public class SessionRestController {
|
|||
|
||||
log.info("REST API: DELETE /api/recordings/{}", recordingId);
|
||||
|
||||
if (!this.openviduConfig.isRecordingModuleEnabled()) {
|
||||
// OpenVidu Server configuration property "OPENVIDU_RECORDING" is set to false
|
||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
return new ResponseEntity<>(this.recordingManager.deleteRecordingFromHost(recordingId, false));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue