MCPcopy Index your code
hub / github.com/PyGithub/PyGithub / fixAuthorizationHeader

Function fixAuthorizationHeader

tests/Framework.py:120–133  ·  view source on GitHub ↗
(headers)

Source from the content-addressed store, hash-verified

118
119
120def fixAuthorizationHeader(headers):
121 if "Authorization" in headers:
122 if headers["Authorization"].endswith("ZmFrZV9sb2dpbjpmYWtlX3Bhc3N3b3Jk"):
123 # This special case is here to test the real Authorization header
124 # sent by PyGithub. It would have avoided issue https://github.com/jacquev6/PyGithub/issues/153
125 # because we would have seen that Python 3 was not generating the same
126 # header as Python 2
127 pass
128 elif headers["Authorization"].startswith("token "):
129 headers["Authorization"] = "token private_token_removed"
130 elif headers["Authorization"].startswith("Basic "):
131 headers["Authorization"] = "Basic login_and_password_removed"
132 elif headers["Authorization"].startswith("Bearer "):
133 headers["Authorization"] = "Bearer jwt_removed"
134
135
136@dataclass

Callers 2

requestMethod · 0.85
__readNextRequestMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…