MCPcopy Index your code
hub / github.com/RustPython/RustPython / _parse_realm

Method _parse_realm

Lib/urllib/request.py:935–954  ·  view source on GitHub ↗
(self, header)

Source from the content-addressed store, hash-verified

933 self.add_password = self.passwd.add_password
934
935 def _parse_realm(self, header):
936 # parse WWW-Authenticate header: accept multiple challenges per header
937 found_challenge = False
938 for mo in AbstractBasicAuthHandler.rx.finditer(header):
939 scheme, quote, realm = mo.groups()
940 if quote not in ['"', "'"]:
941 import warnings
942 warnings.warn("Basic Auth Realm was unquoted",
943 UserWarning, 3)
944
945 yield (scheme, realm)
946
947 found_challenge = True
948
949 if not found_challenge:
950 if header:
951 scheme = header.split()[0]
952 else:
953 scheme = ''
954 yield (scheme, None)
955
956 def http_error_auth_reqed(self, authreq, host, req, headers):
957 # host may be an authority (without userinfo) or a URL with an

Callers 1

http_error_auth_reqedMethod · 0.95

Calls 4

finditerMethod · 0.80
groupsMethod · 0.45
warnMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected