cleanup httpx client code
@@ -27,10 +27,7 @@ class OAuth2Auth(Auth, TokenAuth):
url, headers, body = self.prepare(
str(request.url), request.headers, request.content)
headers['Content-Length'] = str(len(body))
-
- updated_request: Request = build_request(url=url, headers=headers, body=body, initial_request=request)
-
- yield updated_request
+ yield build_request(url=url, headers=headers, body=body, initial_request=request)
except KeyError as error:
description = 'Unsupported token_type: {}'.format(str(error))
raise UnsupportedTokenTypeError(description=description)
@@ -43,10 +40,7 @@ class OAuth2ClientAuth(Auth, ClientAuth):
url, headers, body = self.prepare(
request.method, str(request.url), request.headers, request.content)
headers['Content-Length'] = str(len(body))
-
- updated_request: Request = build_request(url=url, headers=headers, body=body, initial_request=request)
-
- yield updated_request
+ yield build_request(url=url, headers=headers, body=body, initial_request=request)
class AsyncOAuth2Client(_OAuth2Client, AsyncClient):
