mirror of
https://github.com/searxng/searxng.git
synced 2025-08-01 01:22:22 +02:00
[upd] upgrade httpx 0.19.0
adjust searx.network module to the new internal API see https://github.com/encode/httpx/pull/1522
This commit is contained in:
parent
602cbc2c99
commit
8e73438cbe
4 changed files with 53 additions and 53 deletions
|
@ -138,12 +138,10 @@ class Network:
|
|||
request = response.request
|
||||
status = f"{response.status_code} {response.reason_phrase}"
|
||||
response_line = f"{response.http_version} {status}"
|
||||
if hasattr(response, "_elapsed"):
|
||||
elapsed_time = f"{response.elapsed.total_seconds()} sec"
|
||||
else:
|
||||
elapsed_time = "stream"
|
||||
content_type = response.headers.get("Content-Type")
|
||||
content_type = f' ({content_type})' if content_type else ''
|
||||
self._logger.debug(
|
||||
f'HTTP Request: {request.method} {request.url} "{response_line}" ({elapsed_time})'
|
||||
f'HTTP Request: {request.method} {request.url} "{response_line}"{content_type}'
|
||||
)
|
||||
|
||||
def get_client(self, verify=None, max_redirects=None):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue