From 3c6356ba363fc82598be0207e6b70a140b03431f Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Wed, 10 Nov 2021 18:15:39 +0200 Subject: [PATCH] ci: fix request_test.v (add missing \r to hardcoded post data) --- examples/vweb/file_upload/index.html | 11 +++++++++++ vlib/net/http/request_test.v | 20 ++++++++++---------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/examples/vweb/file_upload/index.html b/examples/vweb/file_upload/index.html index 1e79400594..e191d3962d 100644 --- a/examples/vweb/file_upload/index.html +++ b/examples/vweb/file_upload/index.html @@ -1,3 +1,11 @@ + + + + +Test multipart/form-data file uploading + + +

File Upload

File form: @@ -13,3 +21,6 @@ Text form: + + + diff --git a/vlib/net/http/request_test.v b/vlib/net/http/request_test.v index 81dd875d01..27abb35a23 100644 --- a/vlib/net/http/request_test.v +++ b/vlib/net/http/request_test.v @@ -103,16 +103,16 @@ fn test_parse_multipart_form() { file := 'bar.v' ct := 'application/octet-stream' contents := ['baz', 'buzz'] - data := "--------------------------$boundary -Content-Disposition: form-data; name=\"${names[0]}\"; filename=\"$file\" -Content-Type: $ct - -${contents[0]} ---------------------------$boundary -Content-Disposition: form-data; name=\"${names[1]}\" - -${contents[1]} ---------------------------$boundary-- + data := "--$boundary +Content-Disposition: form-data; name=\"${names[0]}\"; filename=\"$file\"\r +Content-Type: $ct\r +\r +${contents[0]}\r +--$boundary\r +Content-Disposition: form-data; name=\"${names[1]}\"\r +\r +${contents[1]}\r +--$boundary--\r " form, files := parse_multipart_form(data, boundary) assert files == {