From 4a40cc20b9cacc0c538d52e3131999d0de674c99 Mon Sep 17 00:00:00 2001 From: bptato Date: Thu, 10 Apr 2025 19:39:08 +0200 Subject: formdata: avoid sending CRLF for epilogue it *is* allowed by the RFC, but others don't do it and some servers choke on it. --- src/types/formdata.nim | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/types/formdata.nim b/src/types/formdata.nim index 937ec275..42398b7f 100644 --- a/src/types/formdata.nim +++ b/src/types/formdata.nim @@ -75,7 +75,6 @@ proc calcLength*(this: FormData): int = result += "\r\n".len # header is always followed by \r\n result += "\r\n".len # value is always followed by \r\n result += "--".len + this.boundary.len + "--\r\n".len - result += "\r\n".len proc getContentType*(this: FormData): string = return "multipart/form-data; boundary=" & this.boundary @@ -115,4 +114,3 @@ proc writeEntry*(stream: DynStream; entry: FormDataEntry; boundary: string) = proc writeEnd*(stream: DynStream; boundary: string) = stream.write("--" & boundary & "--\r\n") - stream.write("\r\n") -- cgit