Index: trunk/src/org/openstreetmap/josm/io/OsmServerWriter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmServerWriter.java	(revision 591)
+++ trunk/src/org/openstreetmap/josm/io/OsmServerWriter.java	(revision 592)
@@ -27,5 +27,5 @@
 
 /**
- * Class that uploades all changes to the osm server.
+ * Class that uploads all changes to the osm server.
  *
  * This is done like this: - All objects with id = 0 are uploaded as new, except
@@ -41,8 +41,8 @@
 
 	/**
-	 * This list contain all sucessfull processed objects. The caller of
+	 * This list contain all successful processed objects. The caller of
 	 * upload* has to check this after the call and update its dataset.
 	 *
-	 * If a server connection error occours, this may contain fewer entries
+	 * If a server connection error occurs, this may contain fewer entries
 	 * than where passed in the list to upload*.
 	 */
@@ -192,13 +192,13 @@
 			activeConnection.setConnectTimeout(15000);
 			activeConnection.setRequestMethod(requestMethod);
-			if (addBody)
+            addAuth(activeConnection);
+			if (addBody) {
 				activeConnection.setDoOutput(true);
-			activeConnection.connect();
-			System.out.println("connected");
-			if (addBody) {
 				OutputStream out = activeConnection.getOutputStream();
 				OsmWriter.output(out, new OsmWriter.Single(osm, true));
 				out.close();
-			}
+            }
+			activeConnection.connect();
+			System.out.println("connected");
 
 			int retCode = activeConnection.getResponseCode();
