MCPcopy Index your code
hub / github.com/python-websockets/websockets / build_www_authenticate_basic

Function build_www_authenticate_basic

src/websockets/headers.py:485–496  ·  view source on GitHub ↗

Build a ``WWW-Authenticate`` header for HTTP Basic Auth. Args: realm: Identifier of the protection space.

(realm: str)

Source from the content-addressed store, hash-verified

483
484
485def build_www_authenticate_basic(realm: str) -> str:
486 """
487 Build a ``WWW-Authenticate`` header for HTTP Basic Auth.
488
489 Args:
490 realm: Identifier of the protection space.
491
492 """
493 # https://datatracker.ietf.org/doc/html/rfc7617#section-2
494 realm = build_quoted_string(realm)
495 charset = build_quoted_string("UTF-8")
496 return f"Basic realm={realm}, charset={charset}"
497
498
499_token68_re = re.compile(r"[A-Za-z0-9-._~+/]+=*")

Calls 1

build_quoted_stringFunction · 0.85

Used in the wild real call sites across dependent graphs

searching dependent graphs…