1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-01-31 20:52:13 +01:00

Fixed invalid http accept header

This patch overrides the default JDK accept header that happens to be
invalid, as per RFC 7231.

Real issue: https://bugs.openjdk.java.net/browse/JDK-8163921

Fix https://github.com/arduino/Arduino/issues/10264
This commit is contained in:
Cristian Maglie 2020-06-15 18:14:07 +02:00
parent 5693423bfe
commit 43da7400e4

View File

@ -128,6 +128,11 @@ public class HttpConnectionManager {
.toUpperCase().replace("-", "").substring(0, 16);
HttpURLConnection connection = (HttpURLConnection) requestURL
.openConnection(proxy);
// see https://github.com/arduino/Arduino/issues/10264
// Workaround for https://bugs.openjdk.java.net/browse/JDK-8163921
connection.setRequestProperty("Accept", "*/*");
connection.setRequestProperty("User-agent", userAgent);
connection.setRequestProperty("X-Request-ID", requestId);
if (id != null) {