slick-2 icon indicating copy to clipboard operation
slick-2 copied to clipboard

make code to communicate with reCaptcha easier to read and understand

Open chrismade opened this issue 7 years ago • 0 comments

proposal / improvement - the current code in function validateCaptcha in file /core/src/main/java/org/millr/slick/servlets/comment/EditComment.java could be made easier to read and understand, e.g.

  • why is remoteIP transferred as argument but not used
  • what is the purpose of the tika functions
  • nested "try"s and closing logic in "finally"
  • as json result returned from reCaptcha is pretty simple we could use regex for processing and write error status in log file if there is any

the function seems to work as it is currently - but in case of troubleshooting - e.g. if connect to https://www.google.com/recaptcha/api/siteverify is not working - a more straight forward code might be helpful

chrismade avatar Jan 13 '18 17:01 chrismade