deepl-java icon indicating copy to clipboard operation
deepl-java copied to clipboard

fix: issue#62 strip auth key

Open timazhum opened this issue 9 months ago • 4 comments

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.

timazhum avatar Feb 13 '25 22:02 timazhum