mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-04-23 22:27:17 -04:00
Fixed logging of proxied client requests while authenticating. #2721
This commit is contained in:
parent
23c19db2e2
commit
ac1a3c5eb0
1 changed files with 3 additions and 1 deletions
|
@ -11,7 +11,9 @@ from app.config import settings
|
|||
|
||||
|
||||
def check_credentials(user, pw, request, log_success=True):
|
||||
ip_addr = request.environ.get('HTTP_X_FORWARDED_FOR', request.remote_addr)
|
||||
forwarded_for_ip_addr = request.environ.get('HTTP_X_FORWARDED_FOR')
|
||||
real_ip_addr = request.environ.get('HTTP_X_REAL_IP')
|
||||
ip_addr = forwarded_for_ip_addr or real_ip_addr or request.remote_addr
|
||||
username = settings.auth.username
|
||||
password = settings.auth.password
|
||||
if hashlib.md5(f"{pw}".encode('utf-8')).hexdigest() == password and user == username:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue