Index: trunk/src/org/openstreetmap/josm/tools/HttpClient.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/HttpClient.java	(revision 9313)
+++ trunk/src/org/openstreetmap/josm/tools/HttpClient.java	(revision 9314)
@@ -42,5 +42,4 @@
     private byte[] requestBody;
     private long ifModifiedSince;
-    private long contentLength;
     private final Map<String, String> headers = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
     private int maxRedirects = Main.pref.getInteger("socket.maxredirects", 5);
@@ -86,7 +85,4 @@
             connection.setIfModifiedSince(ifModifiedSince);
         }
-        if (contentLength > 0) {
-            connection.setFixedLengthStreamingMode(contentLength);
-        }
         connection.setUseCaches(useCache);
         if (!useCache) {
@@ -104,5 +100,5 @@
         if ("PUT".equals(requestMethod) || "POST".equals(requestMethod) || "DELETE".equals(requestMethod)) {
             Main.info("{0} {1} ({2}) ...", requestMethod, url, Utils.getSizeString(requestBody.length, Locale.getDefault()));
-            headers.put("Content-Length", String.valueOf(requestBody.length));
+            connection.setFixedLengthStreamingMode(requestBody.length);
             connection.setDoOutput(true);
             try (OutputStream out = new BufferedOutputStream(
@@ -517,7 +513,8 @@
      * @see HttpURLConnection#setFixedLengthStreamingMode(long)
      * @since 9178
-     */
+     * @deprecated Submitting data via POST, PUT, DELETE automatically sets this property on the connection
+     */
+    @Deprecated
     public HttpClient setFixedLengthStreamingMode(long contentLength) {
-        this.contentLength = contentLength;
         return this;
     }
