8000 Relaxed constraint on getBody() to support PUT and DELETE requests · javaxt-project/javaxt-jetty@4f26a79 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4f26a79

Browse files
author
pborissow
committed
Relaxed constraint on getBody() to support PUT and DELETE requests
git-svn-id: svn://192.168.0.80/JavaXT/javaxt-jetty@1298 2c7b0aa6-e0b2-3c4e-bb4a-8b65b6c465ff
1 parent 90c1741 commit 4f26a79

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/javaxt/http/servlet/HttpServletRequest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -654,8 +654,10 @@ public int getContentLength(){
654654
*/
655655
public byte[] getBody() throws IOException {
656656

657-
//Only POST should have a body. Otherwise, return an empty array.
658-
if (!this.getMethod().equals("POST")) return new byte[0];
657+
//Only POST, PUT, AND DELETE should have a body. Otherwise, return an empty array.
658+
String method = this.getMethod();
659+
if (method.equals("POST") || method.equals("PUT") || method.equals("DELETE")){}
660+
else return new byte[0];
659661

660662

661663
//If the client specified a Content-Length of 0, simply return an empty

0 commit comments

Comments
 (0)
0