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