Make sure checksum validation is done first in join API and display an error without redirection in failure case.

This commit is contained in:
Ghazi Triki 2021-02-09 19:03:54 +01:00
parent 8a1cf91b94
commit 5f683809cd

View File

@ -209,7 +209,12 @@ class ApiController {
// BEGIN - backward compatibility
if (StringUtils.isEmpty(params.checksum)) {
invalid("checksumError", "You did not pass the checksum security check", REDIRECT_RESPONSE)
invalid("checksumError", "You did not pass the checksum security check")
return
}
if (!paramsProcessorUtil.isChecksumSame(API_CALL, params.checksum, request.getQueryString())) {
invalid("checksumError", "You did not pass the checksum security check")
return
}
@ -241,11 +246,6 @@ class ApiController {
return
}
if (!paramsProcessorUtil.isChecksumSame(API_CALL, params.checksum, request.getQueryString())) {
invalid("checksumError", "You did not pass the checksum security check", REDIRECT_RESPONSE)
return
}
// END - backward compatibility
// Do we have a checksum? If none, complain.