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 return Result(true);
755}
756
757Result HttpIncomingMessage::writeHeaders(const uint32_t maxSize, Span<const char> readData, AsyncReadableStream& stream,
758 AsyncBufferView::ID bufferID, bool stopAtHeadersEnd,
759 bool unshiftPendingBodyToStream)
760{
761 attachReadableStream(stream);
762 const auto onParserResult = [&](const HttpParser&) -> Result { return Result(true); };
763 SC_TRY(parsedHeaders.writeHeaders(maxSize, readData, stream, bufferID, stopAtHeadersEnd, unshiftPendingBodyToStream,
764 onParserResult));
765 return Result(true);
766}
767
768size_t HttpIncomingMessage::getHeadersLength() const { return parsedHeaders.getHeadersLength(); }
769
770bool HttpIncomingMessage::isMultipart() const
771{
772 StringSpan contentType;
773 if (getHeader("Content-Type", contentType))
774 {
775 return HttpStringIterator::startsWithIgnoreCase(contentType, "multipart/form-data");
776 }
777 return false;
778}
779
780StringSpan HttpIncomingMessage::getBoundary() const
781{
782 StringSpan contentType;
783 if (getHeader("Content-Type", contentType))
784 {
785 HttpStringIterator it(contentType);

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