validate method
ValidationResult
validate(
- covariant ValidationRequest<
String> request, - covariant String? data
override
Implementation
@override
ValidationResult validate(
covariant ValidationRequest<String> request, covariant String? data) {
if (data == null || request.validationData == null) {
return ValidationResult.not();
}
if (data != request.validationData) {
return ValidationResult.not();
} else {
return ValidationResult.ok(
// contentType: validationResponse.contentType,
headers: {
HttpHeaders.etagHeader: data,
HttpHeaders.contentLengthHeader: 0
}, statusCode: 304);
}
//
// if (request.validationData == validationResponse.value) {
// return ValidationResult.ok(headers: {
// HttpHeaders.etagHeader: validationResponse.value,
// HttpHeaders.contentLengthHeader: 0
// }, statusCode: 304);
// } else {
// return ValidationResult.not();
// }
}