From 30ed877c56005cc0af8adcb3d676f7e24bc01b93 Mon Sep 17 00:00:00 2001 From: Luna Date: Tue, 13 Apr 2021 21:57:11 -0300 Subject: [PATCH 1/2] use much better hack to remove CRLF from body --- src/main.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.zig b/src/main.zig index c2ef559..4f0b652 100644 --- a/src/main.zig +++ b/src/main.zig @@ -243,7 +243,9 @@ const Multipart = struct { // read body until we find the boundary end marker (--{s} OR --{s}--) var it = std.mem.split(remaining_body, self.boundary); 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_body = self.stream.buffer[next_boundary_pos..self.stream.buffer.len]; From 8cffb0d8090b7ac10d7c47283ffc956583d06825 Mon Sep 17 00:00:00 2001 From: Luna Date: Tue, 13 Apr 2021 23:19:42 -0300 Subject: [PATCH 2/2] use my fork of apple_pie --- zig.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zig.mod b/zig.mod index a7359dd..6185d5e 100644 --- a/zig.mod +++ b/zig.mod @@ -3,7 +3,7 @@ name: yet-another-pomf-clone main: src/main.zig dev_dependencies: - - src: git https://github.com/Luukdegram/apple_pie + - src: git https://github.com/lun-4/apple_pie name: apple_pie main: src/apple_pie.zig