openvidu-server recordings path fix

pull/30/head
pabloFuente 2018-01-29 17:44:09 +01:00
parent b9fd3f3c22
commit 67df201054
2 changed files with 2 additions and 4 deletions

View File

@ -24,7 +24,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
.antMatchers("/").authenticated(); .antMatchers("/").authenticated();
if (openviduConf.getOpenViduRecordingFreeAccess()) { if (openviduConf.getOpenViduRecordingFreeAccess()) {
conf = conf.antMatchers("/recordings/*").anonymous(); conf = conf.antMatchers("/recordings/*").permitAll();
} else { } else {
conf = conf.antMatchers("/recordings/*").authenticated(); conf = conf.antMatchers("/recordings/*").authenticated();
} }

View File

@ -1,7 +1,6 @@
package io.openvidu.server.recording; package io.openvidu.server.recording;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
@ -9,7 +8,6 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
import io.openvidu.server.config.OpenviduConfig; import io.openvidu.server.config.OpenviduConfig;
@Configuration @Configuration
@ConditionalOnExpression("'${openvidu.recording}' == 'true'")
public class RecordingsHttpHandler extends WebMvcConfigurerAdapter { public class RecordingsHttpHandler extends WebMvcConfigurerAdapter {
@Autowired @Autowired
@ -20,7 +18,7 @@ public class RecordingsHttpHandler extends WebMvcConfigurerAdapter {
String recordingsPath = openviduConfig.getOpenViduRecordingPath(); String recordingsPath = openviduConfig.getOpenViduRecordingPath();
recordingsPath = recordingsPath.endsWith("/") ? recordingsPath : recordingsPath + "/"; recordingsPath = recordingsPath.endsWith("/") ? recordingsPath : recordingsPath + "/";
registry.addResourceHandler("/recordings/**").addResourceLocations("file:" + recordingsPath); registry.addResourceHandler("/recordings/**").addResourceLocations("file:" + recordingsPath);
} }