ASF Bugzilla – Attachment 29742 Details for
Bug 54142
HTTP Proxy Server throws an exception when path contains "|" character
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Corrected patch - double encoding problem
HTTPHC4Impl.java.patch (text/plain), 2.15 KB, created by
Marek
on 2012-12-11 10:34:20 UTC
(
hide
)
Description:
Corrected patch - double encoding problem
Filename:
MIME Type:
Creator:
Marek
Created:
2012-12-11 10:34:20 UTC
Size:
2.15 KB
patch
obsolete
>Index: src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java >=================================================================== >--- src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java (revision 1418369) >+++ src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java (working copy) >@@ -231,7 +231,21 @@ > > HttpRequestBase httpRequest = null; > try { >- URI uri = url.toURI(); >+ String urlContentEncoding = getContentEncodingOrNull(); >+ if(urlContentEncoding == null || urlContentEncoding.length() == 0) { >+ // Use the default encoding for urls >+ urlContentEncoding = EncoderCache.URL_ARGUMENT_ENCODING; >+ } >+ >+ URI uri = new URI(url.getProtocol(), >+ null /*userInfo*/, >+ url.getHost(), >+ url.getPort(), >+ // path and query might be already encoded so to prevent double encoding first it is decoded >+ URLDecoder.decode(url.getPath(), urlContentEncoding), >+ URLDecoder.decode(url.getQuery(), urlContentEncoding), >+ null /*fragment*/); >+ > if (method.equals(HTTPConstants.POST)) { > httpRequest = new HttpPost(uri); > } else if (method.equals(HTTPConstants.PUT)) { >@@ -249,7 +263,10 @@ > } else if (method.equals(HTTPConstants.PATCH)) { > httpRequest = new HttpPatch(uri); > } else { >- throw new IllegalArgumentException("Unexpected method: "+method); >+ throw new IllegalArgumentException(String.format("Unexpected method: \"%s\" for url: \"%s\" frameDepth=%d", >+ method, >+ url.toString(), >+ frameDepth)); > } > setupRequest(url, httpRequest, res); // can throw IOException > } catch (Exception e) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 54142
:
29595
|
29741
|
29742
|
30670