File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed
src/main/java/com/browserstack/local Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 33 <groupId >com.browserstack</groupId >
44 <artifactId >browserstack-local-java</artifactId >
55 <packaging >jar</packaging >
6- <version >1.1.6 </version >
6+ <version >1.1.7 </version >
77
88 <name >browserstack-local-java</name >
99 <description >Java bindings for BrowserStack Local</description >
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ public class Local {
2323 private LocalProcess proc = null ;
2424
2525 // Current version of binding package, used for --source option of binary
26- private static final String packageVersion = "1.1.6 " ;
26+ private static final String packageVersion = "1.1.7 " ;
2727 private final Map <String , String > parameters ;
2828 private final Map <String , String > avoidValueParameters ;
2929
Original file line number Diff line number Diff line change @@ -207,12 +207,17 @@ private void fetchSourceUrl() throws LocalException {
207207 connection .setRequestProperty ("Content-Type" , "application/json" );
208208 connection .setRequestProperty ("User-Agent" , "browserstack-local-java/" + Local .getPackageVersion ());
209209 connection .setRequestProperty ("Accept" , "application/json" );
210- if (fallbackEnabled ) connection .setRequestProperty ("X-Local-Fallback-Cloudflare" , "true" );
211210
212- String jsonInput = "{\" auth_token\" : \" " + key + (fallbackEnabled ? ("\" , \" error_message\" : \" " + downloadFailureThrowable .getMessage ()) + "\" " : "\" " ) + "}" ;
211+ JSONObject inputParams = new JSONObject ();
212+ inputParams .put ("auth_token" , this .key );
213+ if (fallbackEnabled ) {
214+ connection .setRequestProperty ("X-Local-Fallback-Cloudflare" , "true" );
215+ inputParams .put ("error_message" , downloadFailureThrowable .getMessage ());
216+ }
217+ String jsonInputParams = inputParams .toString ();
213218
214219 try (OutputStream os = connection .getOutputStream ()) {
215- byte [] input = jsonInput .getBytes ("utf-8" );
220+ byte [] input = jsonInputParams .getBytes ("utf-8" );
216221 os .write (input , 0 , input .length );
217222 }
218223
You can’t perform that action at this time.
0 commit comments