MCPcopy
hub / github.com/pallets/werkzeug / test_bad_authorization_header_encoding

Method test_bad_authorization_header_encoding

tests/test_http.py:238–241  ·  view source on GitHub ↗

If the base64 encoded bytes can't be decoded as UTF-8

(self)

Source from the content-addressed store, hash-verified

236 assert Authorization.from_header("Basic foo") is None
237
238 def test_bad_authorization_header_encoding(self):
239 """If the base64 encoded bytes can't be decoded as UTF-8"""
240 content = base64.b64encode(b"\xffser:pass").decode()
241 assert Authorization.from_header(f"Basic {content}") is None
242
243 def test_authorization_eq(self):
244 basic1 = Authorization.from_header("Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==")

Callers

nothing calls this directly

Calls 1

from_headerMethod · 0.45

Tested by

no test coverage detected