feat: remember boundary from parsing
All checks were successful
Compilation test / build (push) Successful in 15m19s
All checks were successful
Compilation test / build (push) Successful in 15m19s
This commit is contained in:
parent
43b262bd8c
commit
193a9ee85b
@ -381,6 +381,10 @@ void body::parseImpl(
|
||||
m_contents = make_shared <streamContentHandler>(contentStream, length, enc);
|
||||
}
|
||||
|
||||
if (!boundary.empty()) {
|
||||
m_boundary = boundary;
|
||||
}
|
||||
|
||||
setParsedBounds(position, end);
|
||||
|
||||
if (newPosition) {
|
||||
@ -439,8 +443,7 @@ void body::generateImpl(
|
||||
|
||||
if (!m_part) {
|
||||
|
||||
boundary = generateRandomBoundaryString();
|
||||
|
||||
boundary = m_boundary.empty() ? generateRandomBoundaryString() : m_boundary;
|
||||
} else {
|
||||
|
||||
// Use current boundary string, if specified. If no "Content-Type" field is
|
||||
@ -457,13 +460,13 @@ void body::generateImpl(
|
||||
} else {
|
||||
|
||||
// No boundary string specified
|
||||
boundary = generateRandomBoundaryString();
|
||||
boundary = m_boundary.empty() ? generateRandomBoundaryString() : m_boundary;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
// No Content-Type (and no boundary string specified)
|
||||
boundary = generateRandomBoundaryString();
|
||||
boundary = m_boundary.empty() ? generateRandomBoundaryString() : m_boundary;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -306,7 +306,8 @@ private:
|
||||
|
||||
|
||||
string m_prologText;
|
||||
string m_epilogText;
|
||||
string m_epilogText;
|
||||
string m_boundary;
|
||||
|
||||
shared_ptr <const contentHandler> m_contents;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user