Changeset 17656 in josm


Ignore:
Timestamp:
2021-03-24T17:56:03+01:00 (4 years ago)
Author:
simon04
Message:

fix #20661 - Remote control: fix usage report (HTML)

http://localhost:8111/

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java

    r17534 r17656  
    254254                String help = "No command specified! The following commands are available:<ul>" + usage
    255255                        + "</ul>" + "See <a href=\""+websiteDoc+"\">"+websiteDoc+"</a> for complete documentation.";
    256                 sendBadRequest(out, help);
     256                sendErrorHtml(out, 400, "Bad Request", help);
    257257            } else {
    258258                // create handler object
     
    302302
    303303    private static void sendError(Writer out, int errorCode, String errorName, String help) throws IOException {
     304        sendErrorHtml(out, errorCode, errorName, help == null ? "" : "<p>"+Utils.escapeReservedCharactersHTML(help) + "</p>");
     305    }
     306
     307    private static void sendErrorHtml(Writer out, int errorCode, String errorName, String helpHtml) throws IOException {
    304308        sendHeader(out, errorCode + " " + errorName, "text/html", true);
    305309        out.write(String.format(
     
    307311                "<title>" + errorName + "</title>",
    308312                "<h1>HTTP Error " + errorCode + ": " + errorName + "</h1>" +
    309                 (help == null ? "" : "<p>"+Utils.escapeReservedCharactersHTML(help) + "</p>")
     313                helpHtml
    310314        ));
    311315        out.flush();
Note: See TracChangeset for help on using the changeset viewer.