The advanced header matching section of the documentation suggests that to set a custom header matcher globally one can do:
HeaderValueMatcher.DEFAULT_MATCHERS["X-Foo"] = some_matcher
However, when attempting to actually do that in a project that uses mypy one gets the following error:
Unsupported target for indexed assignment ("Mapping[str, Callable[[Optional[str], str], bool]]")
The advanced header matching section of the documentation suggests that to set a custom header matcher globally one can do:
However, when attempting to actually do that in a project that uses mypy one gets the following error: