diff --git a/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java b/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java index c878b8e..7160245 100644 --- a/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java +++ b/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java @@ -224,20 +224,8 @@ public class HTTPHC3Impl extends HTTPHCAbstractImpl { httpMethod = new TraceMethod(urlStr); } else if (method.equals(HTTPConstants.OPTIONS)){ httpMethod = new OptionsMethod(urlStr); - } else if (method.equals(HTTPConstants.DELETE)){ - httpMethod = new EntityEnclosingMethod(urlStr) { - @Override - public String getName() { // HC3.1 does not have the method - return HTTPConstants.DELETE; - } - }; - } else if (method.equals(HTTPConstants.PATCH)){ - httpMethod = new EntityEnclosingMethod(urlStr) { - @Override - public String getName() { // HC3.1 does not have the method - return HTTPConstants.PATCH; - } - }; + } else if (HttpWebdav.isWebdavMethod(method)) { + httpMethod = new WebdavMethod(urlStr, method); } else { throw new IllegalArgumentException("Unexpected method: '"+method+"'"); } @@ -1147,4 +1135,18 @@ public class HTTPHC3Impl extends HTTPHCAbstractImpl { return client != null; } + private static class WebdavMethod extends EntityEnclosingMethod { + private final String method; + + public WebdavMethod(String urlstr, String method) { + super(urlstr); + this.method = method; + } + + @Override + public String getName() { + return this.method; + } + } + }