Changeset b3c30b4


Ignore:
Timestamp:
Jul 19, 2009 10:32:29 PM (11 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
7d7f264
Parents:
6c87005
Message:
  • HTTP Proxy: Fix proxy.i2p "home page" (thanks dr|z3d)
File:
1 edited

Legend:

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

    r6c87005 rb3c30b4  
    817817     */
    818818    private static void serveLocalFile(OutputStream out, String method, String targetRequest) {
     819        // a home page message for the curious...
     820        if (targetRequest.startsWith("proxy.i2p/ ")) {
     821            try {
     822                out.write(("HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\nCache-Control: max-age=86400\r\n\r\nI2P HTTP proxy OK").getBytes());
     823                out.flush();
     824            } catch (IOException ioe) {}
     825            return;
     826        }
    819827        if ((method.equals("GET") || method.equals("HEAD")) &&
    820828            targetRequest.startsWith("proxy.i2p/themes/") &&
     
    825833                filename = targetRequest.substring(10, space);
    826834            } catch (IndexOutOfBoundsException ioobe) {}
    827             if (filename == null || filename.length() <= 0) {
    828                 try {
    829                     out.write(("HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\nCache-Control: max-age=86400\r\n\r\nI2P HTTP proxy OK").getBytes());
    830                     out.flush();
    831                 } catch (IOException ioe) {}
    832                 return;
    833             }
    834835            // theme hack
    835836            if (filename.startsWith("themes/console/default/"))
Note: See TracChangeset for help on using the changeset viewer.