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);
|
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);
|
Recording recording = recordingManager.getStartedRecording(recordingId);
|
||||||
|
|
||||||
if (recording == null) {
|
if (recording == null) {
|
||||||
|
@ -634,6 +639,11 @@ public class SessionRestController {
|
||||||
|
|
||||||
log.info("REST API: GET /api/recordings/{}", recordingId);
|
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 {
|
try {
|
||||||
Recording recording = this.recordingManager.getRecording(recordingId);
|
Recording recording = this.recordingManager.getRecording(recordingId);
|
||||||
if (io.openvidu.java.client.Recording.Status.started.equals(recording.getStatus())
|
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");
|
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();
|
Collection<Recording> recordings = this.recordingManager.getAllRecordings();
|
||||||
JsonObject json = new JsonObject();
|
JsonObject json = new JsonObject();
|
||||||
JsonArray jsonArray = new JsonArray();
|
JsonArray jsonArray = new JsonArray();
|
||||||
|
@ -671,6 +686,11 @@ public class SessionRestController {
|
||||||
|
|
||||||
log.info("REST API: DELETE /api/recordings/{}", recordingId);
|
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));
|
return new ResponseEntity<>(this.recordingManager.deleteRecordingFromHost(recordingId, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue