You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by GitBox <gi...@apache.org> on 2022/05/24 02:28:42 UTC
[GitHub] [httpcomponents-client] j3graham opened a new pull request, #369: HTTPCLIENT-2218: Use Java 8 Base64 classes
j3graham opened a new pull request, #369:
URL: https://github.com/apache/httpcomponents-client/pull/369
Provides a minimal version of the commons-codec Base-64 classes for use with httpcomonents-client.
Code updates to use the new utility are also included, keeping the needed changes as small as possible.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org
[GitHub] [httpcomponents-client] ok2c commented on pull request #369: HTTPCLIENT-2218: Use Java 8 Base64 classes
Posted by GitBox <gi...@apache.org>.
ok2c commented on PR #369:
URL: https://github.com/apache/httpcomponents-client/pull/369#issuecomment-1135499398
@j3graham The PR actually looks pretty good. Why is it closed?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org
[GitHub] [httpcomponents-client] j3graham closed pull request #369: HTTPCLIENT-2218: Use Java 8 Base64 classes
Posted by GitBox <gi...@apache.org>.
j3graham closed pull request #369: HTTPCLIENT-2218: Use Java 8 Base64 classes
URL: https://github.com/apache/httpcomponents-client/pull/369
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org
[GitHub] [httpcomponents-client] j3graham commented on pull request #369: HTTPCLIENT-2218: Use Java 8 Base64 classes
Posted by GitBox <gi...@apache.org>.
j3graham commented on PR #369:
URL: https://github.com/apache/httpcomponents-client/pull/369#issuecomment-1135788880
New one also drops the commons-codec dependency for production (my own test code obsessively compares the behaviour of the two)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org
[GitHub] [httpcomponents-client] j3graham commented on a diff in pull request #369: HTTPCLIENT-2218: Use Java 8 Base64 classes
Posted by GitBox <gi...@apache.org>.
j3graham commented on code in PR #369:
URL: https://github.com/apache/httpcomponents-client/pull/369#discussion_r880005209
##########
httpclient5-testing/src/main/java/org/apache/hc/client5/testing/auth/BasicAuthTokenExtractor.java:
##########
@@ -49,9 +47,9 @@ public String extract(final String challengeResponse) throws HttpException {
final String s = challengeResponse.substring(i + 1).trim();
try {
final byte[] credsRaw = s.getBytes(StandardCharsets.US_ASCII);
- final BinaryDecoder codec = new Base64();
+ final Base64 codec = new Base64();
return new String(codec.decode(credsRaw), StandardCharsets.US_ASCII);
- } catch (final DecoderException ex) {
Review Comment:
The DecoderException was caught because BinaryDecoder declared it, however the commons-codec Base64 implementation never actually threw it. Leaving handling here as a hint on how bad encoding could be handlerd
##########
httpclient5-testing/src/main/java/org/apache/hc/client5/testing/auth/BasicAuthTokenExtractor.java:
##########
@@ -49,9 +47,9 @@ public String extract(final String challengeResponse) throws HttpException {
final String s = challengeResponse.substring(i + 1).trim();
try {
final byte[] credsRaw = s.getBytes(StandardCharsets.US_ASCII);
- final BinaryDecoder codec = new Base64();
+ final Base64 codec = new Base64();
return new String(codec.decode(credsRaw), StandardCharsets.US_ASCII);
- } catch (final DecoderException ex) {
Review Comment:
The DecoderException was caught because BinaryDecoder declared it, however the commons-codec Base64 implementation never actually threw it. Leaving handling here as a hint on how bad encoding could be handled.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org
[GitHub] [httpcomponents-client] j3graham commented on pull request #369: HTTPCLIENT-2218: Use Java 8 Base64 classes
Posted by GitBox <gi...@apache.org>.
j3graham commented on PR #369:
URL: https://github.com/apache/httpcomponents-client/pull/369#issuecomment-1135784273
I opened a new one - https://github.com/apache/httpcomponents-client/pull/370
Closed this due to accidentally pulling in changes like the codeql one.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org