Changeset bd6cf53d for apps


Ignore:
Timestamp:
Feb 3, 2019 5:29:16 PM (16 months ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
0e029f8
Parents:
e20a6a9
Message:

i2ptunnel: Fix HTTP websockets by passing through
Connection headers containing "upgrade" (ticket #2422)
Server-side change only. Client-side in previous commit.

File:
1 edited

Legend:

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

    re20a6a9 rbd6cf53d  
    517517            if (spoofHost != null)
    518518                setEntry(headers, "Host", spoofHost);
    519             setEntry(headers, "Connection", "close");
     519
     520            // Force Connection: close, unless websocket
     521            String conn = getEntryOrNull(headers, "Connection");
     522            if (conn == null || !conn.toLowerCase(Locale.US).contains("upgrade"))
     523                setEntry(headers, "Connection", "close");
     524
    520525            // we keep the enc sent by the browser before clobbering it, since it may have
    521526            // been x-i2p-gzip
     
    10451050                else if ("referer".equals(lcName))
    10461051                    name = "Referer";
     1052                else if ("connection".equals(lcName))
     1053                    name = "Connection";
    10471054
    10481055                // For incoming, we remove certain headers to prevent spoofing.
Note: See TracChangeset for help on using the changeset viewer.