Index: trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java	(revision 17655)
+++ trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java	(revision 17656)
@@ -254,5 +254,5 @@
                 String help = "No command specified! The following commands are available:<ul>" + usage
                         + "</ul>" + "See <a href=\""+websiteDoc+"\">"+websiteDoc+"</a> for complete documentation.";
-                sendBadRequest(out, help);
+                sendErrorHtml(out, 400, "Bad Request", help);
             } else {
                 // create handler object
@@ -302,4 +302,8 @@
 
     private static void sendError(Writer out, int errorCode, String errorName, String help) throws IOException {
+        sendErrorHtml(out, errorCode, errorName, help == null ? "" : "<p>"+Utils.escapeReservedCharactersHTML(help) + "</p>");
+    }
+
+    private static void sendErrorHtml(Writer out, int errorCode, String errorName, String helpHtml) throws IOException {
         sendHeader(out, errorCode + " " + errorName, "text/html", true);
         out.write(String.format(
@@ -307,5 +311,5 @@
                 "<title>" + errorName + "</title>",
                 "<h1>HTTP Error " + errorCode + ": " + errorName + "</h1>" +
-                (help == null ? "" : "<p>"+Utils.escapeReservedCharactersHTML(help) + "</p>")
+                helpHtml
         ));
         out.flush();
