MCPcopy Create free account
hub / github.com/WallBreaker2/op / normalize_endpoint

Function normalize_endpoint

libop/network/HttpClient.cpp:118–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116}
117
118bool normalize_endpoint(std::string &endpoint, const char *default_path_suffix) {
119 ParsedUrl parsed;
120 if (!parse_url(endpoint, parsed)) {
121 return false;
122 }
123 if (parsed.path == L"/") {
124 if (!endpoint.empty() && endpoint.back() == '/') {
125 endpoint += default_path_suffix;
126 } else {
127 endpoint += '/';
128 endpoint += default_path_suffix;
129 }
130 }
131 return parse_url(endpoint, parsed);
132}
133
134bool resolve_endpoint_candidate(const std::string &candidate, std::string &endpoint,
135 const std::function<bool(const std::string &, std::string &)> &try_alias) {

Callers 3

YoloDetectorMethod · 0.85
configure_endpointFunction · 0.85
HttpOcrServiceMethod · 0.85

Calls 2

parse_urlFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected