You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by Jie Ren <ji...@ics.uci.edu> on 2005/03/21 18:38:09 UTC

Webdav client, Httpclient 2, and Httpclient 3

It seems there is a problem with the depth support when using Webdav client
with Commons httpclient 3 rc1. 

At first, I was writing some code to forward a request received in a proxy
filter: 

method.setURI(new URI(request.getRequestURI(), true));
method = new PropFindMethod();            
// copy header
Enumeration		headerNames = request.getHeaderNames();
while(headerNames.hasMoreElements()) {
	String		headerName = (String)headerNames.nextElement();
	Enumeration	headers = request.getHeaders(headerName);
	while(headers.hasMoreElements()) {
		String	headerValue = (String)headers.nextElement();
		method.addRequestHeader(headerName, headerValue);
	}
}
// handle depth
if (method instanceof DepthSupport) {
	try {
		if (request.getIntHeader("Depth") != -1)
	
((DepthSupport)method).setDepth(request.getIntHeader("Depth"));
	}
	catch (NumberFormatException nfe) {
	}
}

Not sure whether copying headers would be enough to set the depth header,
but it seems the inquiry of DepthSupport and the setDepth function is
necessary to set the depth field properly.

A possibly related issue arises when executing the commnandline WebDAV
client against the 2.2pre Slide (built from CVS HEAD, running on Jetty
5.1.2) using the httpclient 3 jar, instead of the httpclient.jar coming from
CVS HEAD (which looks like 2.0 final (2.0.2 is also working)). Turning on
debug of the command line client, it seems the request goes to the server
with headers like "depth: 0; content-length: 123; depth: 0". The server
complains no content body against this PROPFIND request. 

Not sure where the real problem is or whether this would qualify as a "bug",
but just let who may be in charge know.

Regards,
Jie Ren


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org