Author: sebb
Date: Fri Nov 16 16:56:00 2007
New Revision: 595888

URL: http://svn.apache.org/viewvc?rev=595888&view=rev
Log:
Proxy spoofing can now use RE matching to determine which urls to spoof (useful 
if images are not https)

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

Modified: 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/Proxy.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/Proxy.java?rev=595888&r1=595887&r2=595888&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/Proxy.java
 (original)
+++ 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/Proxy.java
 Fri Nov 16 16:56:00 2007
@@ -80,6 +80,8 @@
        /** Whether to try to spoof as https **/
        private boolean httpsSpoof;
 
+       private String httpsSpoofMatch; // if non-empty, then URLs must match 
in order to be spoofed
+
     /** Reference to Deamon's Map of url string to page character encoding of 
that page */
     private Map pageEncodings;
     /** Reference to Deamon's Map of url string to character encoding for the 
form */
@@ -132,6 +134,7 @@
         this.clientSocket = _clientSocket;
         this.captureHttpHeaders = _target.getCaptureHttpHeaders();
         this.httpsSpoof = _target.getHttpsSpoof();
+        this.httpsSpoofMatch = _target.getHttpsSpoofMatch();
         this.pageEncodings = _pageEncodings;
         this.formEncodings = _formEncodings;
     }
@@ -173,7 +176,14 @@
                         * If we are trying to spoof https, change the protocol
                         */
                        if (httpsSpoof) {
-                               sampler.setProtocol("https");
+                               if (httpsSpoofMatch.length() > 0){
+                                       String url = request.getUrl();
+                                       if (url.matches(httpsSpoofMatch)){
+                                               
sampler.setProtocol(HTTPConstants.PROTOCOL_HTTPS);                              
                
+                                       }
+                               } else {
+                                   
sampler.setProtocol(HTTPConstants.PROTOCOL_HTTPS);
+                               }
                        }
                        sampler.threadStarted(); // Needed for HTTPSampler2
                        result = sampler.sample();

Modified: jakarta/jmeter/trunk/xdocs/changes.xml
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/xdocs/changes.xml?rev=595888&r1=595887&r2=595888&view=diff
==============================================================================
--- jakarta/jmeter/trunk/xdocs/changes.xml (original)
+++ jakarta/jmeter/trunk/xdocs/changes.xml Fri Nov 16 16:56:00 2007
@@ -64,7 +64,7 @@
 </li>
 <li>Default HTTPSampleResult to ISO-8859-1 encoding</li>
 <li>Fix default encoding for blank encoding</li>
-<li>Fix Https spoofing</li>
+<li>Fix Https spoofing (port problem)</li>
 </ul>
 
 <h4>Improvements</h4>
@@ -105,6 +105,8 @@
 <li>Add hostname to items that can be saved in CSV and XML output files.</li>
 <li>Errors only flag is now supported when loading XML and CSV files</li>
 <li>Ensure ResultCollector uses SaveService encoding</li>
+<li>Proxy now rejects attempts to use it with https</li>
+<li>Proxy spoofing can now use RE matching to determine which urls to spoof 
(useful if images are not https)</li>
 </ul>
 
 <h4>Non-functional Improvements</h4>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to