aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMiguel A. Martin <miguel@schibstediberica.es>2014-05-19 16:04:55 +0200
committerMiguel M <miguel.a.martin@gmail.com>2014-06-16 09:53:32 +0000
commite7cdf98078bc94a2e430d9edef7e9b01250765ac (patch)
tree3e67262e5057110f1757dd22ce12307bf99aa68a /src
parent04884d344043063aaff1bef567912e1be0f254ff (diff)
downloadvolley-e7cdf98078bc94a2e430d9edef7e9b01250765ac.tar.gz
Fixes bug in PATCH method. Sets the method before setting the body.
Just look at PUT and POST methods some lines above. The method is set before calling to addBodyIfExists(). The method should be set before adding the body. Otherwise, some libraries will try to establish a connection with the wrong method (GET by default). Change-Id: I993a62cdc5cbccbf54f9bae4f6b183e2edf4304d
Diffstat (limited to 'src')
-rw-r--r--src/com/android/volley/toolbox/HurlStack.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/com/android/volley/toolbox/HurlStack.java b/src/com/android/volley/toolbox/HurlStack.java
index 49bdf6a..31d57f0 100644
--- a/src/com/android/volley/toolbox/HurlStack.java
+++ b/src/com/android/volley/toolbox/HurlStack.java
@@ -223,8 +223,8 @@ public class HurlStack implements HttpStack {
connection.setRequestMethod("TRACE");
break;
case Method.PATCH:
- addBodyIfExists(connection, request);
connection.setRequestMethod("PATCH");
+ addBodyIfExists(connection, request);
break;
default:
throw new IllegalStateException("Unknown method type.");