Skip to content

Commit eb055cc

Browse files
Mattia Bertorellocmaglie
authored andcommitted
Add user agent in the connection to api-builder.arduino.cc/builder/v1/boards/
1 parent 05de5c9 commit eb055cc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arduino-core/src/processing/app/Platform.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ public synchronized void getBoardWithMatchingVidPidFromCloud(String vid, String
208208
try {
209209
URL jsonUrl = new URL("http", "api-builder.arduino.cc", 80, "/builder/v1/boards/0x"+vid+"/0x"+pid);
210210
URLConnection connection = jsonUrl.openConnection();
211+
String userAgent = "ArduinoIDE/" + BaseNoGui.VERSION_NAME + " Java/"
212+
+ System.getProperty("java.version");
213+
connection.setRequestProperty("User-agent", userAgent);
211214
connection.connect();
212215
HttpURLConnection httpConnection = (HttpURLConnection) connection;
213216
int code = httpConnection.getResponseCode();

0 commit comments

Comments
 (0)