Changeset 167839b


Ignore:
Timestamp:
Feb 14, 2018 12:54:16 PM (3 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
a62c6a8
Parents:
c48796c0
Message:

i2ptunnel, eepget: Capitalize Cache-Control
Change POST throttle response to 429

Files:
27 edited

Legend:

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

    rc48796c0 r167839b  
    6666         "HTTP/1.1 405 Bad Method\r\n"+
    6767         "Content-Type: text/html; charset=iso-8859-1\r\n"+
    68          "Cache-control: no-cache\r\n"+
     68         "Cache-Control: no-cache\r\n"+
    6969         "Connection: close\r\n"+
    7070         "Proxy-Connection: close\r\n"+
     
    7777         "HTTP/1.1 403 Access Denied\r\n"+
    7878         "Content-Type: text/html; charset=iso-8859-1\r\n"+
    79          "Cache-control: no-cache\r\n"+
     79         "Cache-Control: no-cache\r\n"+
    8080         "Connection: close\r\n"+
    8181         "Proxy-Connection: close\r\n"+
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java

    rc48796c0 r167839b  
    9999            "HTTP/1.1 403 Access Denied\r\n" +
    100100            "Content-Type: text/html; charset=iso-8859-1\r\n" +
    101             "Cache-control: no-cache\r\n" +
     101            "Cache-Control: no-cache\r\n" +
    102102            "Connection: close\r\n"+
    103103            "Proxy-Connection: close\r\n"+
     
    110110    ("HTTP/1.1 504 Gateway Timeout\r\n"+
    111111    "Content-Type: text/html; charset=iso-8859-1\r\n"+
    112     "Cache-control: no-cache\r\n\r\n"+
     112    "Cache-Control: no-cache\r\n\r\n"+
    113113    "<html><body><H1>I2P ERROR: TIMEOUT</H1>"+
    114114    "That Destination was reachable, but timed out getting a "+
     
    122122            "HTTP/1.1 503 Service Unavailable\r\n" +
    123123            "Content-Type: text/html; charset=iso-8859-1\r\n" +
    124             "Cache-control: no-cache\r\n" +
     124            "Cache-Control: no-cache\r\n" +
    125125            "Connection: close\r\n"+
    126126            "Proxy-Connection: close\r\n"+
     
    133133            "HTTP/1.1 409 Conflict\r\n" +
    134134            "Content-Type: text/html; charset=iso-8859-1\r\n" +
    135             "Cache-control: no-cache\r\n" +
     135            "Cache-Control: no-cache\r\n" +
    136136            "Connection: close\r\n"+
    137137            "Proxy-Connection: close\r\n"+
     
    150150            "HTTP/1.1 404 Not Found\r\n" +
    151151            "Content-Type: text/html; charset=iso-8859-1\r\n" +
    152             "Cache-control: no-cache\r\n" +
     152            "Cache-Control: no-cache\r\n" +
    153153            "Connection: close\r\n"+
    154154            "Proxy-Connection: close\r\n"+
     
    162162            "HTTP/1.1 409 New Address\r\n" +
    163163            "Content-Type: text/html; charset=iso-8859-1\r\n" +
    164             "Cache-control: no-cache\r\n" +
     164            "Cache-Control: no-cache\r\n" +
    165165            "Connection: close\r\n"+
    166166            "Proxy-Connection: close\r\n"+
     
    175175            "HTTP/1.1 403 Bad Protocol\r\n" +
    176176            "Content-Type: text/html; charset=iso-8859-1\r\n" +
    177             "Cache-control: no-cache\r\n" +
     177            "Cache-Control: no-cache\r\n" +
    178178            "Connection: close\r\n"+
    179179            "Proxy-Connection: close\r\n"+
     
    186186            "HTTP/1.1 403 Bad URI\r\n" +
    187187            "Content-Type: text/html; charset=iso-8859-1\r\n" +
    188             "Cache-control: no-cache\r\n" +
     188            "Cache-Control: no-cache\r\n" +
    189189            "Connection: close\r\n"+
    190190            "Proxy-Connection: close\r\n"+
     
    197197            "HTTP/1.1 403 Access Denied\r\n" +
    198198            "Content-Type: text/html; charset=iso-8859-1\r\n" +
    199             "Cache-control: no-cache\r\n" +
     199            "Cache-Control: no-cache\r\n" +
    200200            "Connection: close\r\n"+
    201201            "Proxy-Connection: close\r\n"+
     
    207207            "HTTP/1.1 403 SSL Rejected\r\n" +
    208208            "Content-Type: text/html; charset=iso-8859-1\r\n" +
    209             "Cache-control: no-cache\r\n" +
     209            "Cache-Control: no-cache\r\n" +
    210210            "Connection: close\r\n"+
    211211            "Proxy-Connection: close\r\n"+
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClientBase.java

    rc48796c0 r167839b  
    7474            "HTTP/1.1 407 Proxy Authentication Required\r\n" +
    7575            "Content-Type: text/html; charset=UTF-8\r\n" +
    76             "Cache-control: no-cache\r\n" +
     76            "Cache-Control: no-cache\r\n" +
    7777            "Connection: close\r\n"+
    7878            "Proxy-Connection: close\r\n"+
     
    9191         "HTTP/1.1 503 No Outproxy Configured\r\n"+
    9292         "Content-Type: text/html; charset=iso-8859-1\r\n"+
    93          "Cache-control: no-cache\r\n"+
     93         "Cache-Control: no-cache\r\n"+
    9494         "Connection: close\r\n"+
    9595         "Proxy-Connection: close\r\n"+
     
    102102            "HTTP/1.1 503 Service Unavailable\r\n" +
    103103            "Content-Type: text/html; charset=iso-8859-1\r\n" +
    104             "Cache-control: no-cache\r\n" +
     104            "Cache-Control: no-cache\r\n" +
    105105            "Connection: close\r\n"+
    106106            "Proxy-Connection: close\r\n"+
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPServer.java

    rc48796c0 r167839b  
    9191         "HTTP/1.1 503 Service Unavailable\r\n"+
    9292         "Content-Type: text/html; charset=iso-8859-1\r\n"+
    93          "Cache-control: no-cache\r\n"+
     93         "Cache-Control: no-cache\r\n"+
    9494         "Connection: close\r\n"+
    9595         "Proxy-Connection: close\r\n"+
     
    100100         "</body></html>";
    101101
     102    // TODO https://stackoverflow.com/questions/16022624/examples-of-http-api-rate-limiting-http-response-headers
    102103    private final static String ERR_DENIED =
    103          "HTTP/1.1 403 Denied\r\n"+
     104         "HTTP/1.1 429 Denied\r\n"+
    104105         "Content-Type: text/html; charset=iso-8859-1\r\n"+
    105          "Cache-control: no-cache\r\n"+
     106         "Cache-Control: no-cache\r\n"+
    106107         "Connection: close\r\n"+
    107108         "Proxy-Connection: close\r\n"+
    108109         "\r\n"+
    109          "<html><head><title>403 Denied</title></head>\n"+
    110          "<body><h2>403 Denied</h2>\n" +
     110         "<html><head><title>429 Denied</title></head>\n"+
     111         "<body><h2>429 Denied</h2>\n" +
    111112         "<p>Denied due to excessive requests. Please try again later.</p>\n" +
    112113         "</body></html>";
     
    115116         "HTTP/1.1 403 Denied\r\n"+
    116117         "Content-Type: text/html; charset=iso-8859-1\r\n"+
    117          "Cache-control: no-cache\r\n"+
     118         "Cache-Control: no-cache\r\n"+
    118119         "Connection: close\r\n"+
    119120         "Proxy-Connection: close\r\n"+
     
    127128         "HTTP/1.1 503 Service Unavailable\r\n"+
    128129         "Content-Type: text/html; charset=iso-8859-1\r\n"+
    129          "Cache-control: no-cache\r\n"+
     130         "Cache-Control: no-cache\r\n"+
    130131         "Connection: close\r\n"+
    131132         "Proxy-Connection: close\r\n"+
     
    139140         "HTTP/1.1 414 Request URI too long\r\n"+
    140141         "Content-Type: text/html; charset=iso-8859-1\r\n"+
    141          "Cache-control: no-cache\r\n"+
     142         "Cache-Control: no-cache\r\n"+
    142143         "Connection: close\r\n"+
    143144         "Proxy-Connection: close\r\n"+
     
    150151         "HTTP/1.1 431 Request header fields too large\r\n"+
    151152         "Content-Type: text/html; charset=iso-8859-1\r\n"+
    152          "Cache-control: no-cache\r\n"+
     153         "Cache-Control: no-cache\r\n"+
    153154         "Connection: close\r\n"+
    154155         "Proxy-Connection: close\r\n"+
     
    162163         "HTTP/1.1 408 Request timeout\r\n"+
    163164         "Content-Type: text/html; charset=iso-8859-1\r\n"+
    164          "Cache-control: no-cache\r\n"+
     165         "Cache-Control: no-cache\r\n"+
    165166         "Connection: close\r\n"+
    166167         "Proxy-Connection: close\r\n"+
     
    173174         "HTTP/1.1 400 Bad Request\r\n"+
    174175         "Content-Type: text/html; charset=iso-8859-1\r\n"+
    175          "Cache-control: no-cache\r\n"+
     176         "Cache-Control: no-cache\r\n"+
    176177         "Connection: close\r\n"+
    177178         "Proxy-Connection: close\r\n"+
     
    476477                        _log.warn("Refusing POST since peer is throttled: " + peerB32);
    477478                    try {
    478                         // Send a 403, so the user doesn't get an HTTP Proxy error message
     479                        // Send a 429, so the user doesn't get an HTTP Proxy error message
    479480                        // and blame his router or the network.
    480481                        socket.getOutputStream().write(ERR_DENIED.getBytes("UTF-8"));
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKSServerFactory.java

    rc48796c0 r167839b  
    2626        "HTTP/1.1 403 Access Denied - This is a SOCKS proxy, not a HTTP proxy\r\n" +
    2727        "Content-Type: text/html; charset=iso-8859-1\r\n" +
    28         "Cache-control: no-cache\r\n" +
     28        "Cache-Control: no-cache\r\n" +
    2929        "\r\n" +
    3030        "<html><body><H1>I2P SOCKS PROXY ERROR: REQUEST DENIED</H1>" +
  • apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketEepGet.java

    rc48796c0 r167839b  
    234234        }
    235235        buf.append("Accept-Encoding: \r\n" +
    236                    "Cache-control: no-cache\r\n" +
     236                   "Cache-Control: no-cache\r\n" +
    237237                   "Pragma: no-cache\r\n" +
    238238                   "Connection: close\r\n");
  • core/java/src/net/i2p/util/EepGet.java

    rc48796c0 r167839b  
    13631363        }
    13641364        if (!_allowCaching) {
    1365             buf.append("Cache-control: no-cache\r\n" +
     1365            buf.append("Cache-Control: no-cache\r\n" +
    13661366                       "Pragma: no-cache\r\n");
    13671367        }
  • core/java/src/net/i2p/util/PartialEepGet.java

    rc48796c0 r167839b  
    211211        buf.append("\r\n");
    212212
    213         buf.append("Cache-control: no-cache\r\n" +
     213        buf.append("Cache-Control: no-cache\r\n" +
    214214                   "Pragma: no-cache\r\n" +
    215215                   "Accept-Encoding: \r\n" +
  • installer/resources/proxy/ahelper-conflict-header.ht

    rc48796c0 r167839b  
    22Content-Type: text/html; charset=UTF-8
    33Referrer-Policy: no-referrer
    4 Cache-control: no-cache
     4Cache-Control: no-cache
    55Connection: close
    66Proxy-Connection: close
  • installer/resources/proxy/ahelper-new-header.ht

    rc48796c0 r167839b  
    22Content-Type: text/html; charset=UTF-8
    33Referrer-Policy: no-referrer
    4 Cache-control: no-cache
     4Cache-Control: no-cache
    55Connection: close
    66Proxy-Connection: close
  • installer/resources/proxy/ahelper-notfound-header.ht

    rc48796c0 r167839b  
    11HTTP/1.1 409 Bad Helper
    22Content-Type: text/html; charset=UTF-8
    3 Cache-control: no-cache
     3Cache-Control: no-cache
    44Connection: close
    55Proxy-Connection: close
  • installer/resources/proxy/auth-header.ht

    rc48796c0 r167839b  
    33Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.5
    44Proxy-Authenticate: Basic realm="I2P HTTP Proxy"
    5 Cache-control: no-cache
     5Cache-Control: no-cache
    66Connection: close
    77Proxy-Connection: close
  • installer/resources/proxy/baduri-header.ht

    rc48796c0 r167839b  
    11HTTP/1.1 403 Bad URI
    22Content-Type: text/html; charset=UTF-8
    3 Cache-control: no-cache
     3Cache-Control: no-cache
    44Connection: close
    55Proxy-Connection: close
  • installer/resources/proxy/denied-header.ht

    rc48796c0 r167839b  
    11HTTP/1.1 403 Request Denied
    22Content-Type: text/html; charset=UTF-8
    3 Cache-control: no-cache
     3Cache-Control: no-cache
    44Connection: close
    55Proxy-Connection: close
  • installer/resources/proxy/dnf-header.ht

    rc48796c0 r167839b  
    11HTTP/1.1 504 Gateway Timeout
    22Content-Type: text/html; charset=UTF-8
    3 Cache-control: no-cache
     3Cache-Control: no-cache
    44Connection: close
    55Proxy-Connection: close
  • installer/resources/proxy/dnfb-header.ht

    rc48796c0 r167839b  
    11HTTP/1.1 400 Destination Not Found
    22Content-Type: text/html; charset=UTF-8
    3 Cache-control: no-cache
     3Cache-Control: no-cache
    44Connection: close
    55Proxy-Connection: close
  • installer/resources/proxy/dnfh-header.ht

    rc48796c0 r167839b  
    22Content-Type: text/html; charset=UTF-8
    33Referrer-Policy: no-referrer
    4 Cache-control: no-cache
     4Cache-Control: no-cache
    55Connection: close
    66Proxy-Connection: close
  • installer/resources/proxy/dnfp-header.ht

    rc48796c0 r167839b  
    11HTTP/1.1 504 Gateway Timeout
    22Content-Type: text/html; charset=UTF-8
    3 Cache-control: no-cache
     3Cache-Control: no-cache
    44Connection: close
    55Proxy-Connection: close
  • installer/resources/proxy/enc-header.ht

    rc48796c0 r167839b  
    11HTTP/1.1 504 Gateway Timeout
    22Content-Type: text/html; charset=UTF-8
    3 Cache-control: no-cache
     3Cache-Control: no-cache
    44Connection: close
    55Proxy-Connection: close
  • installer/resources/proxy/encp-header.ht

    rc48796c0 r167839b  
    11HTTP/1.1 504 Gateway Timeout
    22Content-Type: text/html; charset=UTF-8
    3 Cache-control: no-cache
     3Cache-Control: no-cache
    44Connection: close
    55Proxy-Connection: close
  • installer/resources/proxy/localhost-header.ht

    rc48796c0 r167839b  
    11HTTP/1.1 403 Access Denied
    22Content-Type: text/html; charset=UTF-8
    3 Cache-control: no-cache
     3Cache-Control: no-cache
    44Connection: close
    55Proxy-Connection: close
  • installer/resources/proxy/nols-header.ht

    rc48796c0 r167839b  
    11HTTP/1.1 504 Gateway Timeout
    22Content-Type: text/html; charset=UTF-8
    3 Cache-control: no-cache
     3Cache-Control: no-cache
    44Connection: close
    55Proxy-Connection: close
  • installer/resources/proxy/nolsp-header.ht

    rc48796c0 r167839b  
    11HTTP/1.1 504 Gateway Timeout
    22Content-Type: text/html; charset=UTF-8
    3 Cache-control: no-cache
     3Cache-Control: no-cache
    44Connection: close
    55Proxy-Connection: close
  • installer/resources/proxy/noproxy-header.ht

    rc48796c0 r167839b  
    11HTTP/1.1 503 No Outproxy Configured
    22Content-Type: text/html; charset=UTF-8
    3 Cache-control: no-cache
     3Cache-Control: no-cache
    44Connection: close
    55Proxy-Connection: close
  • installer/resources/proxy/protocol-header.ht

    rc48796c0 r167839b  
    11HTTP/1.1 403 Bad Protocol
    22Content-Type: text/html; charset=UTF-8
    3 Cache-control: no-cache
     3Cache-Control: no-cache
    44Connection: close
    55Proxy-Connection: close
  • installer/resources/proxy/reset-header.ht

    rc48796c0 r167839b  
    11HTTP/1.1 403 Connection Reset
    22Content-Type: text/html; charset=UTF-8
    3 Cache-control: no-cache
     3Cache-Control: no-cache
    44Connection: close
    55Proxy-Connection: close
  • installer/resources/proxy/resetp-header.ht

    rc48796c0 r167839b  
    11HTTP/1.1 403 Connection Reset
    22Content-Type: text/html; charset=UTF-8
    3 Cache-control: no-cache
     3Cache-Control: no-cache
    44Connection: close
    55Proxy-Connection: close
Note: See TracChangeset for help on using the changeset viewer.