Changeset 11952 in josm for trunk/src/org


Ignore:
Timestamp:
2017-04-18T17:43:03+02:00 (7 years ago)
Author:
stoecker
Message:

fix #14717 - fix remote control help request

File:
1 edited

Legend:

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

    r11567 r11952  
    225225                String help = "No command specified! The following commands are available:<ul>" + usage
    226226                        + "</ul>" + "See <a href=\""+websiteDoc+"\">"+websiteDoc+"</a> for complete documentation.";
    227                 sendBadRequest(out, help);
     227                sendHeader(out, "400 Bad Request", "text/html", true);
     228                out.write(String.format(
     229                        RESPONSE_TEMPLATE,
     230                        "<title>Bad Request</title>",
     231                        "<h1>HTTP Error 400: Bad Request</h1>" +
     232                        "<p>" + help + "</p>"));
     233                out.flush();
    228234            } else {
    229235                // create handler object
     
    330336     * Sends a 400 error: bad request
    331337     *
    332      * @param out
    333      *            The writer where the error is written
    334      * @param help
    335      *            Optional HTML help content to display, can be null
    336      * @throws IOException
    337      *             If the error can not be written
     338     * @param out The writer where the error is written
     339     * @param help Optional help content to display, can be null
     340     * @throws IOException If the error can not be written
    338341     */
    339342    private static void sendBadRequest(Writer out, String help) throws IOException {
Note: See TracChangeset for help on using the changeset viewer.