add xfs check

This commit is contained in:
zzz
2010-04-12 22:01:50 +00:00
parent 902377b92a
commit eda5699f38
4 changed files with 6 additions and 4 deletions

View File

@ -10,7 +10,6 @@
<pathelement location="${i2plib}/i2p.jar" />
<pathelement location="${i2plib}/i2ptunnel.jar" />
<pathelement location="${i2plib}/i2psnark.jar" />
<pathelement location="${i2plib}/routerconsole.jar" />
<pathelement location="${jettylib}/ant.jar"/>
<pathelement location="${jettylib}/org.mortbay.jetty.jar"/>
<pathelement location="${jettylib}/jasper-compiler.jar" />

View File

@ -50,11 +50,12 @@
// ignored, use someday to enforce destination
String him = request.getHeader("X-I2P-DestB32");
String xff = request.getHeader("X-Forwarded-For");
String xfs = request.getHeader("X-Forwarded-Server");
boolean fail = false;
String msg = "bad announce";
if (xff != null) {
if (xff != null || xfs != null) {
fail = true;
msg = "Non-I2P access denied";
response.setStatus(403, msg);

View File

@ -33,11 +33,12 @@
response.setHeader("Pragma", "no-cache");
String info_hash = request.getParameter("info_hash");
String xff = request.getHeader("X-Forwarded-For");
String xfs = request.getHeader("X-Forwarded-Server");
boolean fail = false;
String msg = "bad";
if (xff != null) {
if (xff != null || xfs != null) {
fail = true;
msg = "Non-I2P access denied";
response.setStatus(403, msg);

View File

@ -28,6 +28,7 @@
// unused, we don't accept announces
String him = request.getHeader("X-I2P-DestB32");
String xff = request.getHeader("X-Forwarded-For");
String xfs = request.getHeader("X-Forwarded-Server");
response.setContentType("text/plain");
response.setHeader("X-Seedless", me);
@ -35,7 +36,7 @@
final int US_MINUTES = 360;
final int PEER_MINUTES = 60;
if (xff != null) {
if (xff != null || xfs != null) {
String msg = "Non-I2P access denied";
response.setStatus(403, msg);
out.println(msg);