Closed narma closed 2 months ago
Test case for an issue
test("crlf not stripped") {
val content = "1,2\r\n3,4\r\n"
val form = Form(Chunk(
FormField.textField("csv", content, MediaType.text.`csv`)
))
val boundary = Boundary("X-INSOMNIA-BOUNDARY")
val formByteStream = form.multipartBytes(boundary)
val streamingForm = StreamingForm(formByteStream, boundary)
streamingForm.fields.mapZIO { field =>
field.asChunk
}.runCollect
.map { chunks =>
val s = chunks.headOption.map(_.asString)
assertTrue(s.is(_.some).size == content.size, s.is(_.some) == content)
}
}
/bounty $150 for fix and test case to prevent regression.
/attempt #2976
with your implementation plan/claim #2976
in the PR body to claim the bountyThank you for contributing to zio/zio-http!
Add a bounty • Share on socials
Attempt | Started (GMT+0) | Solution |
---|---|---|
🟢 @987Nabil | #2983 |
💡 @987Nabil submitted a pull request that claims the bounty. You can visit your bounty board to reward.
🎉🎈 @987Nabil has been awarded $150! 🎈🎊
zio-http unexpectedly stripped CRLF inside TextField parts in multipart/form-data requests. We are using config with request streaming enabled, other settings are default. It happens with actual csv files which are uploaded via browser on our production code.
Given snippet reproducing the issue