From 58576630dbee46474a25e788cee7bc3737c8bf94 Mon Sep 17 00:00:00 2001 From: Beinsezii <39478211+Beinsezii@users.noreply.github.com> Date: Sat, 23 Nov 2024 13:49:25 -0800 Subject: [PATCH] command/http/client use CRLF for headers join instead of LF (#14417) # Description Apparently it should be joint CRLF for the EOL marker https://www.rfc-editor.org/rfc/rfc2616#section-2.2 Plain LF isn't particularly standardized and many backends don't recognize it. Tested on `starlette` # User-Facing Changes None # Tests + Formatting It's two characters; everything passes # After Submitting Not needed --- crates/nu-command/src/network/http/client.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/nu-command/src/network/http/client.rs b/crates/nu-command/src/network/http/client.rs index 62dd693627..504cc7b632 100644 --- a/crates/nu-command/src/network/http/client.rs +++ b/crates/nu-command/src/network/http/client.rs @@ -376,7 +376,7 @@ fn send_multipart_request( format!("Content-Length: {}", val.len()), ]; builder - .add(&mut Cursor::new(val), &headers.join("\n")) + .add(&mut Cursor::new(val), &headers.join("\r\n")) .map_err(err)?; } else { let headers = format!(r#"Content-Disposition: form-data; name="{}""#, col);