forked from I2P_Developers/i2p.i2p
* i2ptunnel: Block b32.i2p supercookies
This commit is contained in:
@@ -193,6 +193,17 @@ class HTTPResponseOutputStream extends FilterOutputStream {
|
||||
} else if ("content-type".equals(lcKey)) {
|
||||
// save for compress decision on server side
|
||||
_contentType = val;
|
||||
} else if ("set-cookie".equals(lcKey)) {
|
||||
String lcVal = val.toLowerCase(Locale.US);
|
||||
if (lcVal.contains("domain=b32.i2p") ||
|
||||
lcVal.contains("domain=.b32.i2p")) {
|
||||
// Strip privacy-damaging "supercookie" for b32.i2p
|
||||
// Let's presume the user agent ignores a cookie for "i2p"
|
||||
// See RFC 6265 and http://publicsuffix.org/
|
||||
if (_log.shouldLog(Log.INFO))
|
||||
_log.info("Stripping \"" + key + ": " + val + "\" from response ");
|
||||
break;
|
||||
}
|
||||
}
|
||||
out.write((key.trim() + ": " + val.trim() + "\r\n").getBytes());
|
||||
}
|
||||
|
Reference in New Issue
Block a user