Skip to content

Commit 2303137

Browse files
committed
Update content length in POST tests
Upstream curl commit 3aa3cc9b changed MIME multipart boundary from 16 to 22 bytes. Update the tests accordingly. Disable such tests when using system curl to avoid expected failure.
1 parent bc21884 commit 2303137

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/post.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ fn handle() -> Easy {
2323
e
2424
}
2525

26+
#[cfg(feature = "static-curl")]
2627
#[test]
2728
fn custom() {
2829
let s = Server::new();
@@ -31,7 +32,7 @@ fn custom() {
3132
POST / HTTP/1.1\r\n\
3233
Host: 127.0.0.1:$PORT\r\n\
3334
Accept: */*\r\n\
34-
Content-Length: 142\r\n\
35+
Content-Length: 154\r\n\
3536
Content-Type: multipart/form-data; boundary=--[..]\r\n\
3637
\r\n\
3738
--[..]\r\n\
@@ -50,6 +51,7 @@ fn custom() {
5051
t!(handle.perform());
5152
}
5253

54+
#[cfg(feature = "static-curl")]
5355
#[test]
5456
fn buffer() {
5557
let s = Server::new();
@@ -58,7 +60,7 @@ fn buffer() {
5860
POST / HTTP/1.1\r\n\
5961
Host: 127.0.0.1:$PORT\r\n\
6062
Accept: */*\r\n\
61-
Content-Length: 181\r\n\
63+
Content-Length: 193\r\n\
6264
Content-Type: multipart/form-data; boundary=--[..]\r\n\
6365
\r\n\
6466
--[..]\r\n\
@@ -82,6 +84,7 @@ fn buffer() {
8284
t!(handle.perform());
8385
}
8486

87+
#[cfg(feature = "static-curl")]
8588
#[test]
8689
fn file() {
8790
let s = Server::new();
@@ -102,7 +105,7 @@ fn file() {
102105
{}\
103106
\r\n\
104107
--[..]\r\n",
105-
199 + formdata.len(),
108+
211 + formdata.len(),
106109
formdata
107110
)
108111
.as_str(),

0 commit comments

Comments
 (0)