MCPcopy Index your code
hub / github.com/python/cpython / _create_auth_dict

Method _create_auth_dict

Lib/test/test_urllib2_localnet.py:110–125  ·  view source on GitHub ↗
(self, auth_str)

Source from the content-addressed store, hash-verified

108 return nonce
109
110 def _create_auth_dict(self, auth_str):
111 first_space_index = auth_str.find(" ")
112 auth_str = auth_str[first_space_index+1:]
113
114 parts = auth_str.split(",")
115
116 auth_dict = {}
117 for part in parts:
118 name, value = part.split("=")
119 name = name.strip()
120 if value[0] == '"' and value[-1] == '"':
121 value = value[1:-1]
122 else:
123 value = value.strip()
124 auth_dict[name] = value
125 return auth_dict
126
127 def _validate_auth(self, auth_dict, password, method, uri):
128 final_dict = {}

Callers 1

handle_requestMethod · 0.95

Calls 3

findMethod · 0.45
splitMethod · 0.45
stripMethod · 0.45

Tested by

no test coverage detected