MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / make_basic_authentication_header

Function make_basic_authentication_header

examples/server/httplib.h:4818–4824  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4816}
4817
4818inline std::pair<std::string, std::string>
4819make_basic_authentication_header(const std::string &username,
4820 const std::string &password, bool is_proxy) {
4821 auto field = "Basic " + detail::base64_encode(username + ":" + password);
4822 auto key = is_proxy ? "Proxy-Authorization" : "Authorization";
4823 return std::make_pair(key, std::move(field));
4824}
4825
4826inline std::pair<std::string, std::string>
4827make_bearer_token_authentication_header(const std::string &token,

Callers 1

write_requestMethod · 0.85

Calls 1

base64_encodeFunction · 0.85

Tested by

no test coverage detected