Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add final boundary for multipart entities with no parts #1257 #1260

Merged
merged 1 commit into from
Jul 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ private[http] object BodyPartRenderer {
renderHeaders(r, part.headers, log)
r ~~ part.entity.data
}
renderFinalBoundary(r, boundary)
}
renderFinalBoundary(r, boundary)
r.get
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ class MarshallingSpec extends FreeSpec with Matchers with BeforeAndAfterAll with

"The MultipartMarshallers" - {
"multipartMarshaller should correctly marshal multipart content with" - {
"no parts" in {
marshal(Multipart.General(`multipart/mixed`)) shouldEqual HttpEntity(
contentType = (`multipart/mixed` withBoundary randomBoundary).toContentType,
data = ByteString(s"""
|--$randomBoundary--""".stripMarginWithNewline("\r\n")))
}
"one empty part" in {
marshal(Multipart.General(`multipart/mixed`, Multipart.General.BodyPart.Strict(""))) shouldEqual HttpEntity(
contentType = (`multipart/mixed` withBoundary randomBoundary).toContentType,
Expand Down