Skip to content

Commit 43da740

Browse files
committed
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 #10264
1 parent 5693423 commit 43da740

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

arduino-core/src/cc/arduino/utils/network/HttpConnectionManager.java

+5
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ private HttpURLConnection makeConnection(URL requestURL, int movedTimes,
128128
.toUpperCase().replace("-", "").substring(0, 16);
129129
HttpURLConnection connection = (HttpURLConnection) requestURL
130130
.openConnection(proxy);
131+
132+
// see https://github.com/arduino/Arduino/issues/10264
133+
// Workaround for https://bugs.openjdk.java.net/browse/JDK-8163921
134+
connection.setRequestProperty("Accept", "*/*");
135+
131136
connection.setRequestProperty("User-agent", userAgent);
132137
connection.setRequestProperty("X-Request-ID", requestId);
133138
if (id != null) {

0 commit comments

Comments
 (0)