Remove unnecessary intermediate variable ip.

master
voussoir 2021-06-04 21:33:55 -07:00
parent 7f8a007e2d
commit 47c4790d36
No known key found for this signature in database
GPG Key ID: 5F7554F8C26DACCB
1 changed files with 1 additions and 2 deletions

View File

@ -78,8 +78,7 @@ site.route = decorate_and_route
@site.before_request
def before_request():
ip = request.remote_addr
request.is_localhost = ip == '127.0.0.1'
request.is_localhost = (request.remote_addr == '127.0.0.1')
if site.localhost_only and not request.is_localhost:
flask.abort(403)