Skip to content

Commit 29d3473

Browse files
Fix #924 (#951)
* Fix #924 * address review comments
1 parent ed47f96 commit 29d3473

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

src/main/java/io/appium/java_client/remote/NewAppiumSessionPayload.java

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -264,21 +264,23 @@ public void writeTo(Appendable appendable) throws IOException {
264264
json.name(DESIRED_CAPABILITIES);
265265
json.write(first);
266266

267-
// And write the first capability for gecko13
268-
json.name(CAPABILITIES);
269-
json.beginObject();
267+
if (!forceMobileJSONWP) {
268+
// And write the first capability for gecko13
269+
json.name(CAPABILITIES);
270+
json.beginObject();
270271

271-
json.name(ALWAYS_MATCH);
272-
getW3C().forEach(json::write);
273-
274-
json.name(FIRST_MATCH);
275-
json.beginArray();
276-
//noinspection unchecked
277-
json.beginObject();
278-
json.endObject();
279-
json.endArray();
272+
json.name(ALWAYS_MATCH);
273+
getW3C().forEach(json::write);
280274

281-
json.endObject(); // Close "capabilities" object
275+
json.name(FIRST_MATCH);
276+
json.beginArray();
277+
//noinspection unchecked
278+
json.beginObject();
279+
json.endObject();
280+
json.endArray();
281+
282+
json.endObject(); // Close "capabilities" object
283+
}
282284

283285
writeMetaData(json);
284286

0 commit comments

Comments
 (0)