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

(-)src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java (-2 / +19 lines)
Lines 231-237 Link Here
231
        
231
        
232
        HttpRequestBase httpRequest = null;
232
        HttpRequestBase httpRequest = null;
233
        try {
233
        try {
234
            URI uri = url.toURI();
234
            String urlContentEncoding = getContentEncodingOrNull();
235
            if(urlContentEncoding == null || urlContentEncoding.length() == 0) {
236
                // Use the default encoding for urls
237
                urlContentEncoding = EncoderCache.URL_ARGUMENT_ENCODING;
238
            }
239
240
            URI uri = new URI(url.getProtocol(), 
241
                              null /*userInfo*/,
242
                              url.getHost(), 
243
                              url.getPort(), 
244
                              // path and query might be already encoded so to prevent double encoding first it is decoded
245
                              URLDecoder.decode(url.getPath(), urlContentEncoding), 
246
                              URLDecoder.decode(url.getQuery(), urlContentEncoding), 
247
                              null /*fragment*/);
248
235
            if (method.equals(HTTPConstants.POST)) {
249
            if (method.equals(HTTPConstants.POST)) {
236
                httpRequest = new HttpPost(uri);
250
                httpRequest = new HttpPost(uri);
237
            } else if (method.equals(HTTPConstants.PUT)) {
251
            } else if (method.equals(HTTPConstants.PUT)) {
Lines 249-255 Link Here
249
            } else if (method.equals(HTTPConstants.PATCH)) {
263
            } else if (method.equals(HTTPConstants.PATCH)) {
250
                httpRequest = new HttpPatch(uri);
264
                httpRequest = new HttpPatch(uri);
251
            } else {
265
            } else {
252
                throw new IllegalArgumentException("Unexpected method: "+method);
266
                throw new IllegalArgumentException(String.format("Unexpected method: \"%s\" for url: \"%s\" frameDepth=%d", 
267
                                                                 method,
268
                                                                 url.toString(),
269
                                                                 frameDepth));
253
            }
270
            }
254
            setupRequest(url, httpRequest, res); // can throw IOException
271
            setupRequest(url, httpRequest, res); // can throw IOException
255
        } catch (Exception e) {
272
        } catch (Exception e) {

Return to bug 54142