Does httpclient 3.0 work with Slide from HEAD? Was: Re: patch for Slide Ant tasks and commons httpclient 3.0
Eirikur Hrafnsson <[email protected]> Mon, 19 Mar 2007 17:25:23 +0000
| Newsgroups | gmane.comp.jakarta.slide.devel |
|---|---|
| Message-ID | <[email protected]> |
Question for Slide developers or someone who knows... a while ago we tested HttpClient 3.0 with Slide (HEAD) and it didn't work. Does it work now? We are unfortunately forced to use HttpClient 3.0 so I really hope the answer is yes and I only have to rebuild our jar. (we use an older version from HEAD today) Best Regards Eirikur S. Hrafnsson, [email protected] Chief Software Engineer Idega Software http://www.idega.com On Mar 15, 2007, at 10:24 PM, Antoine Levy-Lambert wrote: > Hello Greg, > > thanks for your patch. Will work on it. > > Antoine > -------- Original-Nachricht -------- > Datum: Thu, 15 Mar 2007 15:18:27 -0700 > Von: "Greg Schueler" <[email protected]> > An: [email protected], "Anthony Shortland" > <[email protected]>, "[email protected]" <[email protected]> > CC: > Betreff: patch for Slide Ant tasks and commons httpclient 3.0 > >> Hi Antoine, >> >> re: Slide with commons httpclient 3.0 >> http://issues.apache.org/bugzilla/show_bug.cgi?id=35213 >> >> >> I was able to compile Slide against commons httpclient 3.0, but >> ran into >> one >> bug when using the Ant tasks for slide. Using the Put task fails >> because >> httpclient 3.0 throws an exception: >> >> java.lang.IllegalArgumentException : Entity enclosing requests >> cannot be >> redirected without user intervention >> at >> org.apache.commons.httpclient.methods.EntityEnclosingMethod.setFollow >> Redirects >> (EntityEnclosingMethod.java:221) >> at org.apache.webdav.ant.Utils.putFile (Utils.java:272) >> at org.apache.webdav.ant.taskdefs.Put.uploadFile(Put.java: >> 345) >> >> The attached patch for Utils.java fixes this problem. I'm not >> familiar >> with >> the DAV spec (specifically wrt redirects during a PUT operation), but >> httpclient 3.0 references the HTTP 1.1 RFC so I can't imagine that >> DAV >> goes >> against that RFC. >> >> We are hoping to use Slide with httpclient 3.0 in our software, >> especially >> via the Ant tasks, so we do look forward to having a release >> version of >> slide with that support (rather than building from source ourselves). >> >> Thanks! >> Greg >> >> Index: webdavclient/ant/src/java/org/apache/webdav/ant/Utils.java >> =================================================================== >> --- webdavclient/ant/src/java/org/apache/webdav/ant/Utils.java >> (revision >> 518395) >> +++ webdavclient/ant/src/java/org/apache/webdav/ant/Utils.java >> (working >> copy) >> @@ -269,7 +269,7 @@ >> generateIfHeader(put, lockToken); >> put.setRequestHeader("Content-Type", contentType); >> put.setRequestBody(is); >> - put.setFollowRedirects(true); >> + put.setFollowRedirects(false); >> int status = client.executeMethod(put); >> switch (status) { >> case WebdavStatus.SC_OK: >> -- >> Greg > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] >