mirror of https://github.com/OpenVidu/openvidu.git
openvidu-server: fix https://github.com/OpenVidu/openvidu/issues/549
parent
d0483f9033
commit
2ba178760b
|
@ -38,6 +38,7 @@ import java.util.Map;
|
|||
import javax.annotation.PostConstruct;
|
||||
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.http.Header;
|
||||
import org.apache.http.message.BasicHeader;
|
||||
import org.kurento.jsonrpc.JsonUtils;
|
||||
|
@ -875,7 +876,7 @@ public class OpenviduConfig {
|
|||
|
||||
public URI checkWebsocketUri(String uri) throws Exception {
|
||||
try {
|
||||
if (!uri.startsWith("ws://") || uri.startsWith("wss://")) {
|
||||
if (!StringUtils.startsWithAny(uri, "ws://", "wss://")) {
|
||||
throw new Exception("WebSocket protocol not found");
|
||||
}
|
||||
String parsedUri = uri.replaceAll("^ws://", "http://").replaceAll("^wss://", "https://");
|
||||
|
|
Loading…
Reference in New Issue