Skip to content

Commit

Permalink
Fixed invalid http accept header
Browse files Browse the repository at this point in the history
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 arduino#10264
  • Loading branch information
cmaglie committed Jun 15, 2020
1 parent 5693423 commit 43da740
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ private HttpURLConnection makeConnection(URL requestURL, int movedTimes,
.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) {
Expand Down

0 comments on commit 43da740

Please sign in to comment.