Skip to content

Commit 8ec13fc

Browse files
committed
fix(tests): update of form-data introduces a line break at the end of the final boundary
1 parent b3c6e5d commit 8ec13fc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+48
-42
lines changed

test/fixtures/output/c/libcurl/multipart-data.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ struct curl_slist *headers = NULL;
77
headers = curl_slist_append(headers, "content-type: multipart/form-data; boundary=---011000010111000001101001");
88
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
99

10-
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"foo\"; filename=\"hello.txt\"\r\nContent-Type: text/plain\r\n\r\nHello World\r\n-----011000010111000001101001--");
10+
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"foo\"; filename=\"hello.txt\"\r\nContent-Type: text/plain\r\n\r\nHello World\r\n-----011000010111000001101001--\r\n");
1111

1212
CURLcode ret = curl_easy_perform(hnd);

test/fixtures/output/c/libcurl/multipart-file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ struct curl_slist *headers = NULL;
77
headers = curl_slist_append(headers, "content-type: multipart/form-data; boundary=---011000010111000001101001");
88
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
99

10-
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"foo\"; filename=\"hello.txt\"\r\nContent-Type: text/plain\r\n\r\n\r\n-----011000010111000001101001--");
10+
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"foo\"; filename=\"hello.txt\"\r\nContent-Type: text/plain\r\n\r\n\r\n-----011000010111000001101001--\r\n");
1111

1212
CURLcode ret = curl_easy_perform(hnd);

test/fixtures/output/c/libcurl/multipart-form-data.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ struct curl_slist *headers = NULL;
77
headers = curl_slist_append(headers, "content-type: multipart/form-data; boundary=---011000010111000001101001");
88
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
99

10-
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"foo\"\r\n\r\nbar\r\n-----011000010111000001101001--");
10+
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"foo\"\r\n\r\nbar\r\n-----011000010111000001101001--\r\n");
1111

1212
CURLcode ret = curl_easy_perform(hnd);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var client = new RestClient("http://mockbin.com/har");
22
var request = new RestRequest(Method.POST);
33
request.AddHeader("content-type", "multipart/form-data; boundary=---011000010111000001101001");
4-
request.AddParameter("multipart/form-data; boundary=---011000010111000001101001", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"foo\"; filename=\"hello.txt\"\r\nContent-Type: text/plain\r\n\r\nHello World\r\n-----011000010111000001101001--", ParameterType.RequestBody);
4+
request.AddParameter("multipart/form-data; boundary=---011000010111000001101001", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"foo\"; filename=\"hello.txt\"\r\nContent-Type: text/plain\r\n\r\nHello World\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
55
IRestResponse response = client.Execute(request);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var client = new RestClient("http://mockbin.com/har");
22
var request = new RestRequest(Method.POST);
33
request.AddHeader("content-type", "multipart/form-data; boundary=---011000010111000001101001");
4-
request.AddParameter("multipart/form-data; boundary=---011000010111000001101001", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"foo\"; filename=\"hello.txt\"\r\nContent-Type: text/plain\r\n\r\n\r\n-----011000010111000001101001--", ParameterType.RequestBody);
4+
request.AddParameter("multipart/form-data; boundary=---011000010111000001101001", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"foo\"; filename=\"hello.txt\"\r\nContent-Type: text/plain\r\n\r\n\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
55
IRestResponse response = client.Execute(request);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var client = new RestClient("http://mockbin.com/har");
22
var request = new RestRequest(Method.POST);
33
request.AddHeader("content-type", "multipart/form-data; boundary=---011000010111000001101001");
4-
request.AddParameter("multipart/form-data; boundary=---011000010111000001101001", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"foo\"\r\n\r\nbar\r\n-----011000010111000001101001--", ParameterType.RequestBody);
4+
request.AddParameter("multipart/form-data; boundary=---011000010111000001101001", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"foo\"\r\n\r\nbar\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
55
IRestResponse response = client.Execute(request);

test/fixtures/output/go/native/multipart-data.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ func main() {
1111

1212
url := "http://mockbin.com/har"
1313

14-
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"foo\"; filename=\"hello.txt\"\r\nContent-Type: text/plain\r\n\r\nHello World\r\n-----011000010111000001101001--")
14+
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"foo\"; filename=\"hello.txt\"\r\nContent-Type: text/plain\r\n\r\nHello World\r\n-----011000010111000001101001--\r\n")
1515

1616
req, _ := http.NewRequest("POST", url, payload)
1717

test/fixtures/output/go/native/multipart-file.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ func main() {
1111

1212
url := "http://mockbin.com/har"
1313

14-
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"foo\"; filename=\"hello.txt\"\r\nContent-Type: text/plain\r\n\r\n\r\n-----011000010111000001101001--")
14+
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"foo\"; filename=\"hello.txt\"\r\nContent-Type: text/plain\r\n\r\n\r\n-----011000010111000001101001--\r\n")
1515

1616
req, _ := http.NewRequest("POST", url, payload)
1717

test/fixtures/output/go/native/multipart-form-data.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ func main() {
1111

1212
url := "http://mockbin.com/har"
1313

14-
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"foo\"\r\n\r\nbar\r\n-----011000010111000001101001--")
14+
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"foo\"\r\n\r\nbar\r\n-----011000010111000001101001--\r\n")
1515

1616
req, _ := http.NewRequest("POST", url, payload)
1717

test/fixtures/output/java/okhttp/multipart-data.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
OkHttpClient client = new OkHttpClient();
22

33
MediaType mediaType = MediaType.parse("multipart/form-data; boundary=---011000010111000001101001");
4-
RequestBody body = RequestBody.create(mediaType, "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"foo\"; filename=\"hello.txt\"\r\nContent-Type: text/plain\r\n\r\nHello World\r\n-----011000010111000001101001--");
4+
RequestBody body = RequestBody.create(mediaType, "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"foo\"; filename=\"hello.txt\"\r\nContent-Type: text/plain\r\n\r\nHello World\r\n-----011000010111000001101001--\r\n");
55
Request request = new Request.Builder()
66
.url("http://mockbin.com/har")
77
.post(body)

0 commit comments

Comments
 (0)