Changeset d82499f


Ignore:
Timestamp:
Jan 6, 2018 10:31:41 AM (2 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
b8f17c7
Parents:
62210c8
Message:

i2ptunnel, eepget: Better error message on invalid URLs (ticket #2130)

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java

    r62210c8 rd82499f  
    502502                            _log.warn(getPrefix(requestId) + "Bad request [" + request + "]", use);
    503503                        }
     504                        // TODO fixup []| not escaped by browsers
    504505                        try {
    505506                            out.write(getErrorPage("baduri", ERR_BAD_URI).getBytes("UTF-8"));
     507                            String msg = use.getLocalizedMessage();
     508                            if (msg != null) {
     509                                out.write(DataHelper.getASCII("<p>\n"));
     510                                out.write(DataHelper.getUTF8(DataHelper.escapeHTML(msg)));
     511                                out.write(DataHelper.getASCII("</p>\n"));
     512                            }
     513                            out.write(DataHelper.getASCII("</div>\n"));
    506514                            writeFooter(out);
    507515                            reader.drain();
  • core/java/src/net/i2p/util/EepGet.java

    r62210c8 rd82499f  
    328328            nameURL = new URI(url);
    329329        } catch (URISyntaxException e) {
     330            String msg = e.getLocalizedMessage();
     331            if (msg != null)
     332                System.err.println(msg);
    330333            System.err.println("Please enter a properly formed URL.");
    331334            System.exit(1);
  • installer/resources/proxy/baduri-header.ht

    r62210c8 rd82499f  
    2222_("If you clicked a link, check the end of the URI for any characters the browser has mistakenly added on.")
    2323</p>
    24 </div>
Note: See TracChangeset for help on using the changeset viewer.