From 26b560da1d7850ffb388a45a0c0ce7bfb0bf093f Mon Sep 17 00:00:00 2001 From: Ben Busby Date: Thu, 28 Oct 2021 21:21:21 -0600 Subject: [PATCH] Pass response as str to bsoup for "my ip" card Due to how the response is now reformed into a new bsoup object when bolding search query terms, creating an ip card for "my ip" searches threw an error due to how the new bsoup object was initialized for the "my ip" card. This passes the response in as a string instead. Fixes #504 --- app/routes.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/routes.py b/app/routes.py index bc8ee44..224905e 100644 --- a/app/routes.py +++ b/app/routes.py @@ -253,9 +253,10 @@ def search(): # Return 503 if temporarily blocked by captcha resp_code = 503 if has_captcha(str(response)) else 200 response = bold_search_terms(response, query) + # Feature to display IP address if search_util.check_kw_ip(): - html_soup = bsoup(response, "html.parser") + html_soup = bsoup(str(response), 'html.parser') response = add_ip_card(html_soup, request.remote_addr) return render_template(