File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 1818BANNED_IPS = []
1919
2020# 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']
2222BANNED_SERVERS = []
2323
2424# 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():
7777
7878 if "%s/%d" % (server ["ip" ], server ["port" ]) in app .config ["BANNED_SERVERS" ]:
7979 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" ]:
8183 return "Banned (Server)." , 403
8284
8385 old = serverList .get (ip , server ["port" ])
You can’t perform that action at this time.
0 commit comments