mirror of
https://github.com/searxng/searxng.git
synced 2025-07-13 08:19:17 +02:00
Drop Python 2 (4/n): SearchQuery.query is a str instead of bytes
This commit is contained in:
parent
7888377743
commit
c225db45c8
20 changed files with 48 additions and 48 deletions
|
@ -22,7 +22,7 @@ default_on = True
|
|||
|
||||
|
||||
# Self User Agent regex
|
||||
p = re.compile(b'.*user[ -]agent.*', re.IGNORECASE)
|
||||
p = re.compile('.*user[ -]agent.*', re.IGNORECASE)
|
||||
|
||||
|
||||
# attach callback to the post search hook
|
||||
|
@ -31,7 +31,7 @@ p = re.compile(b'.*user[ -]agent.*', re.IGNORECASE)
|
|||
def post_search(request, search):
|
||||
if search.search_query.pageno > 1:
|
||||
return True
|
||||
if search.search_query.query == b'ip':
|
||||
if search.search_query.query == 'ip':
|
||||
x_forwarded_for = request.headers.getlist("X-Forwarded-For")
|
||||
if x_forwarded_for:
|
||||
ip = x_forwarded_for[0]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue