disable Remote Proctoring URL check on Port 5000

This commit is contained in:
anhefti 2020-10-29 17:18:41 +01:00
parent cbb882fcba
commit 6ea548548f
No known key found for this signature in database
GPG key ID: E9AD9471B6BC114D

View file

@ -8,9 +8,6 @@
package ch.ethz.seb.sebserver.webservice.servicelayer.validation;
import java.net.InetAddress;
import java.net.URI;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
@ -38,22 +35,22 @@ public class ProctoringSettingsValidator implements ConstraintValidator<ValidPro
passed = false;
}
try {
if (!InetAddress.getByName(new URI(value.serverURL).getHost()).isReachable(5000)) {
context.disableDefaultConstraintViolation();
context
.buildConstraintViolationWithTemplate("proctoringSettings:serverURL:serverNotAvailable")
.addPropertyNode("serverURL").addConstraintViolation();
passed = false;
}
} catch (final Exception e) {
context.disableDefaultConstraintViolation();
context
.buildConstraintViolationWithTemplate("proctoringSettings:serverURL:serverNotAvailable")
.addPropertyNode("serverURL").addConstraintViolation();
passed = false;
}
// try {
//
// if (!InetAddress.getByName(new URI(value.serverURL).getHost()).isReachable(5000)) {
// context.disableDefaultConstraintViolation();
// context
// .buildConstraintViolationWithTemplate("proctoringSettings:serverURL:serverNotAvailable")
// .addPropertyNode("serverURL").addConstraintViolation();
// passed = false;
// }
// } catch (final Exception e) {
// context.disableDefaultConstraintViolation();
// context
// .buildConstraintViolationWithTemplate("proctoringSettings:serverURL:serverNotAvailable")
// .addPropertyNode("serverURL").addConstraintViolation();
// passed = false;
// }
if (StringUtils.isBlank(value.appKey)) {
context.disableDefaultConstraintViolation();