jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1412311 - in /jmeter/trunk: src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java xdocs/changes.xml
Date Wed, 21 Nov 2012 21:36:37 GMT
Author: sebb
Date: Wed Nov 21 21:36:36 2012
New Revision: 1412311

URL: http://svn.apache.org/viewvc?rev=1412311&view=rev
Log:
Allow query strings in paths that start with HTTP or HTTPS
(so setPath behaves the same as if the path were set in the GUI)
Bugzilla Id: 54185

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java?rev=1412311&r1=1412310&r2=1412311&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
Wed Nov 21 21:36:36 2012
@@ -395,8 +395,9 @@ public abstract class HTTPSamplerBase ex
     }
 
     /**
-     * Sets the PATH property; also calls {@link #parseArguments(String, String)}
-     * to extract and store any query arguments if the request is a GET or DELETE.
+     * Sets the PATH property; if the request is a GET or DELETE (and the path
+     * does not start with http[s]://) it also calls {@link #parseArguments(String, String)}
+     * to extract and store any query arguments.
      *
      * @param path
      *            The new Path value
@@ -404,7 +405,8 @@ public abstract class HTTPSamplerBase ex
      *            The encoding used for the querystring parameter values
      */
     public void setPath(String path, String contentEncoding) {
-        if (HTTPConstants.GET.equals(getMethod()) || HTTPConstants.DELETE.equals(getMethod()))
{
+        boolean fullUrl = path.startsWith(HTTP_PREFIX) || path.startsWith(HTTPS_PREFIX);

+        if (!fullUrl && (HTTPConstants.GET.equals(getMethod()) || HTTPConstants.DELETE.equals(getMethod())))
{
             int index = path.indexOf(QRY_PFX);
             if (index > -1) {
                 setProperty(PATH, path.substring(0, index));

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1412311&r1=1412310&r2=1412311&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Wed Nov 21 21:36:36 2012
@@ -159,6 +159,7 @@ and right angle bracket (>) in search
 
 <h3>HTTP Samplers</h3>
 <ul>
+<li><bugzilla>54185</bugzilla> - Allow query strings in paths that start
with HTTP or HTTPS</li>
 </ul>
 
 <h3>Other samplers</h3>



Mime
View raw message