This is an automated email from the ASF dual-hosted git repository.
rmaucher pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new c8276244ae Remove dead code
c8276244ae is described below
commit c8276244ae3b5a2d5f0117674fb3881e844e46b3
Author: remm <[email protected]>
AuthorDate: Wed May 20 14:00:13 2026 +0200
Remove dead code
Decoded cannot be null.
---
.../apache/catalina/authenticator/BasicAuthenticator.java | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/java/org/apache/catalina/authenticator/BasicAuthenticator.java
b/java/org/apache/catalina/authenticator/BasicAuthenticator.java
index 97e849b23a..f0f76cc8d5 100644
--- a/java/org/apache/catalina/authenticator/BasicAuthenticator.java
+++ b/java/org/apache/catalina/authenticator/BasicAuthenticator.java
@@ -261,13 +261,14 @@ public class BasicAuthenticator extends AuthenticatorBase
{
private byte[] parseBase64() throws IllegalArgumentException {
byte[] encoded = new byte[base64blobLength];
System.arraycopy(authorization.getBuffer(), base64blobOffset,
encoded, 0, base64blobLength);
- byte[] decoded = Base64.getDecoder().decode(encoded);
- // restore original offset
- authorization.setStart(initialOffset);
- if (decoded == null) {
- throw new
IllegalArgumentException(sm.getString("basicAuthenticator.notBase64"));
+ try {
+ byte[] decoded = Base64.getDecoder().decode(encoded);
+ // restore original offset
+ authorization.setStart(initialOffset);
+ return decoded;
+ } catch (IllegalArgumentException e) {
+ throw new
IllegalArgumentException(sm.getString("basicAuthenticator.notBase64"), e);
}
- return decoded;
}
/*
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]