jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1806295 - in /jmeter/trunk: src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java xdocs/changes.xml
Date Sat, 26 Aug 2017 13:20:18 GMT
Author: pmouawad
Date: Sat Aug 26 13:20:18 2017
New Revision: 1806295

URL: http://svn.apache.org/viewvc?rev=1806295&view=rev
Log:
Bug 61456 - java.lang.ArrayIndexOutOfBoundsException when recording with JMeter and weird
Basic Auth Authorization header 
Bugzilla Id: 61456

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java?rev=1806295&r1=1806294&r2=1806295&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
Sat Aug 26 13:20:18 2017
@@ -688,18 +688,25 @@ public class ProxyControl extends Generi
                             if(BASIC_AUTH.equals(authType)) {
                                 String authCred= new String(Base64.decodeBase64(authCredentialsBase64));
                                 String[] loginPassword = authCred.split(":"); //$NON-NLS-1$
-                                authorization.setUser(loginPassword[0]);
-                                authorization.setPass(loginPassword[1]);
+                                if(loginPassword.length == 2) {
+                                    authorization.setUser(loginPassword[0]);
+                                    authorization.setPass(loginPassword[1]);
+                                } else {
+                                    log.error("Error parsing BASIC Auth authorization header:'{}',
decoded value:'{}'", 
+                                            authCredentialsBase64, authCred);
+                                    // we keep initial header
+                                    return null;
+                                }
                             } else {
                                 // Digest or Kerberos
                                 authorization.setUser("${AUTH_LOGIN}");//$NON-NLS-1$
                                 authorization.setPass("${AUTH_PASSWORD}");//$NON-NLS-1$
-                                
                             }
                         }
                         // remove HEADER_AUTHORIZATION from HeaderManager 
                         // because it's useless after creating Authorization object
                         iterator.remove();
+                        break;
                     }
                 }
             }

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1806295&r1=1806294&r2=1806295&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml [utf-8] (original)
+++ jmeter/trunk/xdocs/changes.xml [utf-8] Sat Aug 26 13:20:18 2017
@@ -171,6 +171,7 @@ Incorporated feed back about unclear doc
   <li><bug>61384</bug>Don't set the charset on enclosing <code>multipart/form-data</code>
header. It irritates some servers.<br/>
      The charset was added sometime back while refactoring to use a newer api of http client.
      See <bug>56141</bug> for more info.</li>
+  <li><bug>61456</bug>java.lang.ArrayIndexOutOfBoundsException when recording
with JMeter and weird Basic Auth Authorization header</li>
 </ul>
 
 <h3>Other Samplers</h3>



Mime
View raw message