/** * Set path on sampler * * @param sampler {@link HTTPSamplerBase} * @param request {@link HttpRequestHdr} */ protected void computePath(HTTPSamplerBase sampler, HttpRequestHdr request) { if (sampler.getContentEncoding() != null) { sampler.setPath(request.getPath(), sampler.getContentEncoding()); } else { // Although the spec says UTF-8 should be used for encoding URL parameters, // most browser use ISO-8859-1 for default if encoding is not known. // We use null for contentEncoding, then the url parameters will be added // with the value in the URL, and the "encode?" flag set to false sampler.setPath(request.getPath(), null); } if (log.isDebugEnabled()) { log.debug("Proxy: setting path: " + sampler.getPath()); } }
public void testSendCookie2() throws Exception { man.add(new Cookie("id", "value", ".apache.org", "/", false, 9999999999L)); HTTPSamplerBase sampler = new HTTPNullSampler(); sampler.setDomain("jakarta.apache.org"); sampler.setPath("/index.html"); sampler.setMethod(HTTPSamplerBase.GET); assertNotNull(man.getCookieHeaderForURL(sampler.getUrl())); }