-
Notifications
You must be signed in to change notification settings - Fork 22
fix: issue#62 strip auth key #64
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: main
Are you sure you want to change the base?
Conversation
Oh, this looks very nice, thanks for that! I will review on monday |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fundamentally looks good to me, thanks :)
I'll just get a second opinion from a colleague by tomorrow.
deepl-java/src/test/java/com/deepl/api/utils/StringUtilTest.java
Outdated
Show resolved
Hide resolved
00a1e54
to
b1f7887
Compare
Amended the commit, using |
Happy to merge this once Leon's comment is addressed :) thanks for your work! |
Fixing the issue raised in DeepLcom#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. We anticipate ASCII only input and utilizing `trim()` for simplicity.
b1f7887
to
15b74df
Compare
✅ Addressed, thanks for all the feedback provided |
Fixing the issue raised in #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()
, whileString.trim()
does not support Unicode whitespaces. Therefore, using regex expressions for stripping.