use much better hack to remove CRLF from body
This commit is contained in:
parent
c3c019f19f
commit
30ed877c56
1 changed files with 3 additions and 1 deletions
|
@ -243,7 +243,9 @@ const Multipart = struct {
|
||||||
// read body until we find the boundary end marker (--{s} OR --{s}--)
|
// read body until we find the boundary end marker (--{s} OR --{s}--)
|
||||||
var it = std.mem.split(remaining_body, self.boundary);
|
var it = std.mem.split(remaining_body, self.boundary);
|
||||||
const almost_actual_body = it.next() orelse return error.MissingPartBody;
|
const almost_actual_body = it.next() orelse return error.MissingPartBody;
|
||||||
const body = std.mem.trimRight(u8, almost_actual_body, "\r\n");
|
|
||||||
|
var body_it = std.mem.split(almost_actual_body, "\r\n");
|
||||||
|
const body = body_it.next().?;
|
||||||
|
|
||||||
const next_boundary_pos = self.stream.pos + body.len;
|
const next_boundary_pos = self.stream.pos + body.len;
|
||||||
const next_boundary_body = self.stream.buffer[next_boundary_pos..self.stream.buffer.len];
|
const next_boundary_body = self.stream.buffer[next_boundary_pos..self.stream.buffer.len];
|
||||||
|
|
Loading…
Reference in a new issue