[enh] Fix uppercase ip query (#2991)

## What does this PR do?

Fixes the self_info plugin to support uppercase ip queries.

## Why is this change important?

This PR solves the mild annoyance of retyping IP in lowercase.

## Related issues

Closes #2888
This commit is contained in:
Flodur871 2021-10-02 11:35:22 +00:00 committed by GitHub
parent 1d5feed4c1
commit 8ecc8c5745
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -31,7 +31,7 @@ p = re.compile('.*user[ -]agent.*', re.IGNORECASE)
def post_search(request, search):
if search.search_query.pageno > 1:
return True
if search.search_query.query == 'ip':
if search.search_query.query.lower() == 'ip':
x_forwarded_for = request.headers.getlist("X-Forwarded-For")
if x_forwarded_for:
ip = x_forwarded_for[0]