MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / getBoundary

Method getBoundary

Libraries/Http/HttpConnection.cpp:756–782  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

754}
755
756StringSpan HttpIncomingMessage::getBoundary() const
757{
758 StringSpan contentType;
759 if (getHeader("Content-Type", contentType))
760 {
761 HttpStringIterator it(contentType);
762 if (it.advanceUntilMatchesIgnoreCase("boundary="))
763 {
764 for (size_t i = 0; i < 9; ++i)
765 (void)it.stepForward();
766
767 if (it.advanceIfMatches('"'))
768 {
769 auto start = it;
770 while (not it.isAtEnd() and not it.match('"'))
771 (void)it.stepForward();
772 return HttpStringIterator::fromIterators(start, it, contentType.getEncoding());
773 }
774
775 auto start = it;
776 char matched;
777 (void)it.advanceUntilMatchesAny({';', ' ', '\r', '\0'}, matched);
778 return HttpStringIterator::fromIterators(start, it, contentType.getEncoding());
779 }
780 }
781 return {};
782}
783
784//-------------------------------------------------------------------------------------------------------
785// HttpRequest

Callers 4

postMultipartMethod · 0.80
validateActiveRequestMethod · 0.80
sendHeadersMethod · 0.80

Calls 6

isAtEndMethod · 0.80
stepForwardMethod · 0.45
advanceIfMatchesMethod · 0.45
matchMethod · 0.45

Tested by

no test coverage detected