You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2011/08/19 19:26:05 UTC
svn commit: r1159698 - in /cxf/branches/2.3.x-fixes: ./
rt/transports/http/src/main/java/org/apache/cxf/transport/http/
systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/
Author: dkulp
Date: Fri Aug 19 17:26:04 2011
New Revision: 1159698
URL: http://svn.apache.org/viewvc?rev=1159698&view=rev
Log:
Merged revisions 1158179 via svnmerge from
https://svn.us.apache.org/repos/asf/cxf/branches/2.4.x-fixes
................
r1158179 | sergeyb | 2011-08-16 06:09:20 -0400 (Tue, 16 Aug 2011) | 9 lines
Merged revisions 1158178 via svnmerge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r1158178 | sergeyb | 2011-08-16 11:05:38 +0100 (Tue, 16 Aug 2011) | 1 line
[CXF-3620] Minor update to check empty strings for PUT requests
........
................
Modified:
cxf/branches/2.3.x-fixes/ (props changed)
cxf/branches/2.3.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
Propchange: cxf/branches/2.3.x-fixes/
('svn:mergeinfo' removed)
Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified: cxf/branches/2.3.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java?rev=1159698&r1=1159697&r2=1159698&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java (original)
+++ cxf/branches/2.3.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java Fri Aug 19 17:26:04 2011
@@ -687,7 +687,11 @@ public class HTTPConduit
if (HTTP_PUT_METHOD.equals(httpMethod)) {
MessageContentsList objs = MessageContentsList.getContentsList(message);
if (objs != null && objs.size() > 0) {
- return true;
+ Object obj = objs.get(0);
+ if (obj.getClass() != String.class
+ || (obj.getClass() == String.class && ((String)obj).length() > 0)) {
+ return true;
+ }
}
}
return false;
Modified: cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java?rev=1159698&r1=1159697&r2=1159698&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java (original)
+++ cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java Fri Aug 19 17:26:04 2011
@@ -132,6 +132,11 @@ public class BookStore {
}
}
+ @PUT
+ @Path("emptyput")
+ public void emptyput() {
+ }
+
@POST
public void emptypostNoPath() {
emptypost();
Modified: cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java?rev=1159698&r1=1159697&r2=1159698&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java (original)
+++ cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java Fri Aug 19 17:26:04 2011
@@ -528,6 +528,20 @@ public class JAXRSClientServerBookTest e
}
@Test
+ public void testEmptyPut() throws Exception {
+ WebClient wc =
+ WebClient.create("http://localhost:"
+ + PORT + "/bookstore/emptyput");
+ Response response = wc.put(null);
+ assertEquals(204, response.getStatus());
+ assertNull(response.getMetadata().getFirst("Content-Type"));
+
+ response = wc.put("");
+ assertEquals(204, response.getStatus());
+ assertNull(response.getMetadata().getFirst("Content-Type"));
+ }
+
+ @Test
public void testEmptyPostProxy() throws Exception {
String address = "http://localhost:" + PORT;
JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();