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 3
3
<groupId >com.browserstack</groupId >
4
4
<artifactId >browserstack-local-java</artifactId >
5
5
<packaging >jar</packaging >
6
- <version >1.1.6 </version >
6
+ <version >1.1.7 </version >
7
7
8
8
<name >browserstack-local-java</name >
9
9
<description >Java bindings for BrowserStack Local</description >
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ public class Local {
23
23
private LocalProcess proc = null ;
24
24
25
25
// 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 " ;
27
27
private final Map <String , String > parameters ;
28
28
private final Map <String , String > avoidValueParameters ;
29
29
Original file line number Diff line number Diff line change @@ -207,12 +207,17 @@ private void fetchSourceUrl() throws LocalException {
207
207
connection .setRequestProperty ("Content-Type" , "application/json" );
208
208
connection .setRequestProperty ("User-Agent" , "browserstack-local-java/" + Local .getPackageVersion ());
209
209
connection .setRequestProperty ("Accept" , "application/json" );
210
- if (fallbackEnabled ) connection .setRequestProperty ("X-Local-Fallback-Cloudflare" , "true" );
211
210
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 ();
213
218
214
219
try (OutputStream os = connection .getOutputStream ()) {
215
- byte [] input = jsonInput .getBytes ("utf-8" );
220
+ byte [] input = jsonInputParams .getBytes ("utf-8" );
216
221
os .write (input , 0 , input .length );
217
222
}
218
223
You can’t perform that action at this time.
0 commit comments