View | Details | Raw Unified | Return to bug 64523
Collapse All | Expand All

(-)a/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/curl/BasicCurlParser.java (-1 / +14 lines)
Lines 46-51 import org.apache.commons.cli.avalon.CLOptionDescriptor; Link Here
46
import org.apache.commons.io.FileUtils;
46
import org.apache.commons.io.FileUtils;
47
import org.apache.commons.lang3.StringUtils;
47
import org.apache.commons.lang3.StringUtils;
48
import org.apache.commons.lang3.tuple.Pair;
48
import org.apache.commons.lang3.tuple.Pair;
49
import org.apache.http.NameValuePair;
50
import org.apache.http.client.utils.URLEncodedUtils;
49
import org.apache.jmeter.protocol.http.control.AuthManager.Mechanism;
51
import org.apache.jmeter.protocol.http.control.AuthManager.Mechanism;
50
import org.apache.jmeter.protocol.http.control.Authorization;
52
import org.apache.jmeter.protocol.http.control.Authorization;
51
import org.apache.jmeter.protocol.http.control.Cookie;
53
import org.apache.jmeter.protocol.http.control.Cookie;
Lines 818-823 public class BasicCurlParser { Link Here
818
                request.setPostData(null);
820
                request.setPostData(null);
819
                request.setMethod("GET");
821
                request.setMethod("GET");
820
            }
822
            }
823
            if ("GET".equals(request.getMethod())) {
824
                String url = request.getUrl();
825
                url = url.replaceAll("\\s*\\\\$", ""); // our CLI parser has a bug, that could lead to stray backslashes
826
                try {
827
                    for (NameValuePair nameValuePair : URLEncodedUtils.parse(new URI(url), StandardCharsets.UTF_8)) {
828
                        request.addFormStringData(nameValuePair.getName(), nameValuePair.getValue());
829
                    }
830
                    request.setUrl(url.substring(0, url.indexOf('?')));
831
                } catch (URISyntaxException e) {
832
                    LOGGER.warn("Could not handle query parameters for URI: {}", url, e);
833
                }
834
            }
821
            return request;
835
            return request;
822
        } else {
836
        } else {
823
            throw new IllegalArgumentException(
837
            throw new IllegalArgumentException(
824
- 

Return to bug 64523