Skip to content

Commit

Permalink
Update http_server.py
Browse files Browse the repository at this point in the history
  • Loading branch information
giga-a authored Oct 4, 2023
1 parent 286f9c1 commit 40b3499
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions honeypots/http_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ def check_bytes(string):
if 'fix_get_client_ip' in _q_s.options:
with suppress(Exception):
raw_headers = dict(request.requestHeaders.getAllRawHeaders())
if b'X-Forwarded-For':
if b'X-Forwarded-For' in raw_headers:
client_ip = check_bytes(raw_headers[b'X-Forwarded-For'][0])
elif b'X-Real-IP':
elif b'X-Real-IP' in raw_headers:
client_ip = check_bytes(raw_headers[b'X-Real-IP'][0])

if client_ip == "":
Expand Down

0 comments on commit 40b3499

Please sign in to comment.