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

Function parse_multipart_boundary

examples/server/httplib.h:3953–3966  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3951}
3952
3953inline bool parse_multipart_boundary(const std::string &content_type,
3954 std::string &boundary) {
3955 auto boundary_keyword = "boundary=";
3956 auto pos = content_type.find(boundary_keyword);
3957 if (pos == std::string::npos) { return false; }
3958 auto end = content_type.find(';', pos);
3959 auto beg = pos + strlen(boundary_keyword);
3960 boundary = content_type.substr(beg, end - beg);
3961 if (boundary.length() >= 2 && boundary.front() == '"' &&
3962 boundary.back() == '"') {
3963 boundary = boundary.substr(1, boundary.size() - 2);
3964 }
3965 return !boundary.empty();
3966}
3967
3968#ifdef CPPHTTPLIB_NO_EXCEPTIONS
3969inline bool parse_range_header(const std::string &s, Ranges &ranges) {

Callers 1

read_content_coreMethod · 0.85

Calls 5

findMethod · 0.80
substrMethod · 0.80
lengthMethod · 0.80
sizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected