Commit ed400251 authored by Georg Mittendorfer's avatar Georg Mittendorfer

Make POW check log less verbose.

parent 56fa90f9
Pipeline #49562917 failed with stage
in 3 minutes and 21 seconds
......@@ -212,18 +212,19 @@ public class IriApiHandler {
String validationTarget = logger.isDebugEnabled()
? String.valueOf(wex.getTarget())
: StringUtils.abbreviate(String.valueOf(wex.getTarget()), 116);
logger.info("Validation failure: [{}]", validationTarget);
logger.info(errorMessage);
if (isUnauthorizedIriCommand(wex.getTarget())) {
// return unauthorized instead of bad request like IRI does it
logger.debug("Received invalid unauthorized [{}] request. Returning 401...", ((IriCommand) wex.getTarget()).getCommand());
logger.info("Received invalid unauthorized request [{}]. Returning 401...", validationTarget);
logger.info(errorMessage);
return createUnauthorizedResponse((IriCommand) wex.getTarget());
} else if (isEmptyAttachToTangle(wex.getTarget())) {
logger.debug("Received empty AttachToTangle. Returning POW enabled response (400)...");
logger.info("Received empty AttachToTangle (POW check). Returning 400...");
// exactly this response is needed for pow check
return invalidCommandResponse();
} else {
logger.info("Validation failure: [{}]", validationTarget);
logger.info(errorMessage);
// this is not 100% compatible with IRI as the error message is much more detailed. If this
// is a problem change to invalidCommandResponse
throw ExceptionHandlerUtil.convertToResponseException(wex, errorMessage);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment