File tree 2 files changed +4
-2
lines changed
2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 18
18
BANNED_IPS = []
19
19
20
20
# List of banned servers as host/port pairs
21
- # e.g. ['1.2.3.4/30000', 'evil.server.ua /30001']
21
+ # e.g. ['1.2.3.4/30000', 'lowercase.hostname', 'lowercase.hostname /30001']
22
22
BANNED_SERVERS = []
23
23
24
24
# Creates server entries if a server sends an 'update' and there is no entry yet.
Original file line number Diff line number Diff line change @@ -77,7 +77,9 @@ def announce():
77
77
78
78
if "%s/%d" % (server ["ip" ], server ["port" ]) in app .config ["BANNED_SERVERS" ]:
79
79
return "Banned (Server)." , 403
80
- elif "address" in server and "%s/%d" % (server ["address" ], server ["port" ]) in app .config ["BANNED_SERVERS" ]:
80
+ elif "address" in server and "%s/%d" % (server ["address" ].lower (), server ["port" ]) in app .config ["BANNED_SERVERS" ]:
81
+ return "Banned (Server)." , 403
82
+ elif "address" in server and server ["address" ].lower () in app .config ["BANNED_SERVERS" ]:
81
83
return "Banned (Server)." , 403
82
84
83
85
old = serverList .get (ip , server ["port" ])
You can’t perform that action at this time.
0 commit comments