deepl-java
deepl-java copied to clipboard
fix: issue#62 strip auth key
Fixing the issue raised in https://github.com/DeepLcom/deepl-java/issues/62
Problem: auth key with leading / trailing whitespaces is throwing exceptions. For example, assigning the secret via echo leaves a trailing \n.
Solution: strip input auth key as an input sanitization procedure
Notice: Java 8 does not support String.strip(), while String.trim() does not support Unicode whitespaces. Therefore, using regex expressions for stripping.