MCPcopy Create free account
hub / github.com/authlib/authlib / get_headers

Method get_headers

authlib/oauth2/rfc6749/errors.py:99–110  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

97 status_code = 400
98
99 def get_headers(self):
100 headers = super().get_headers()
101 if self.status_code == 401:
102 error_description = self.get_error_description()
103 # safe escape
104 error_description = error_description.replace('"', "|")
105 extras = [
106 f'error="{self.error}"',
107 f'error_description="{error_description}"',
108 ]
109 headers.append(("WWW-Authenticate", "Basic " + ", ".join(extras)))
110 return headers
111
112
113class InvalidGrantError(OAuth2Error):

Callers

nothing calls this directly

Calls 2

get_headersMethod · 0.45
get_error_descriptionMethod · 0.45

Tested by

no test coverage detected