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