mirror of
https://github.com/arduino/Arduino.git
synced 2024-12-01 12:24:14 +01:00
Add user agent in the connection to api-builder.arduino.cc/builder/v1/boards/
This commit is contained in:
parent
05de5c9593
commit
eb055cc4c0
@ -208,6 +208,9 @@ public class Platform {
|
||||
try {
|
||||
URL jsonUrl = new URL("http", "api-builder.arduino.cc", 80, "/builder/v1/boards/0x"+vid+"/0x"+pid);
|
||||
URLConnection connection = jsonUrl.openConnection();
|
||||
String userAgent = "ArduinoIDE/" + BaseNoGui.VERSION_NAME + " Java/"
|
||||
+ System.getProperty("java.version");
|
||||
connection.setRequestProperty("User-agent", userAgent);
|
||||
connection.connect();
|
||||
HttpURLConnection httpConnection = (HttpURLConnection) connection;
|
||||
int code = httpConnection.getResponseCode();
|
||||
|
Loading…
Reference in New Issue
Block a user