Skip to content

Commit e0a1feb

Browse files
committed
Merge pull request android-async-http#185 from davidwen/patch-1
Fix creating entity with dupe and file params
2 parents 7333a61 + 0399a07 commit e0a1feb

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/com/loopj/android/http/RequestParams.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,14 @@ public HttpEntity getEntity() {
236236
multipartEntity.addPart(entry.getKey(), entry.getValue());
237237
}
238238

239+
// Add dupe params
240+
for(ConcurrentHashMap.Entry<String, ArrayList<String>> entry : urlParamsWithArray.entrySet()) {
241+
ArrayList<String> values = entry.getValue();
242+
for (String value : values) {
243+
multipartEntity.addPart(entry.getKey(), value);
244+
}
245+
}
246+
239247
// Add file params
240248
int currentIndex = 0;
241249
int lastIndex = fileParams.entrySet().size() - 1;
@@ -252,14 +260,6 @@ public HttpEntity getEntity() {
252260
currentIndex++;
253261
}
254262

255-
// Add dupe params
256-
for(ConcurrentHashMap.Entry<String, ArrayList<String>> entry : urlParamsWithArray.entrySet()) {
257-
ArrayList<String> values = entry.getValue();
258-
for (String value : values) {
259-
multipartEntity.addPart(entry.getKey(), value);
260-
}
261-
}
262-
263263
entity = multipartEntity;
264264
} else {
265265
try {
@@ -318,4 +318,4 @@ public String getFileName() {
318318
}
319319
}
320320
}
321-
}
321+
}

0 commit comments

Comments
 (0)