net.http: fix request_test.v
parent
f9eb14d914
commit
90e04d03b2
|
@ -244,7 +244,7 @@ fn parse_form(body string) map[string]string {
|
||||||
// ...
|
// ...
|
||||||
}
|
}
|
||||||
|
|
||||||
struct FileData {
|
pub struct FileData {
|
||||||
pub:
|
pub:
|
||||||
filename string
|
filename string
|
||||||
content_type string
|
content_type string
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
module vweb
|
module vweb
|
||||||
|
|
||||||
|
import net.http
|
||||||
import io
|
import io
|
||||||
|
|
||||||
struct StringReader {
|
struct StringReader {
|
||||||
|
@ -114,9 +115,9 @@ Content-Disposition: form-data; name=\"${names[1]}\"
|
||||||
${contents[1]}
|
${contents[1]}
|
||||||
--------------------------$boundary--
|
--------------------------$boundary--
|
||||||
"
|
"
|
||||||
form, files := parse_multipart_form(data, boundary)
|
form, files := http.parse_multipart_form(data, boundary)
|
||||||
assert files == {
|
assert files == {
|
||||||
names[0]: [FileData{
|
names[0]: [http.FileData{
|
||||||
filename: file
|
filename: file
|
||||||
content_type: ct
|
content_type: ct
|
||||||
data: contents[0]
|
data: contents[0]
|
||||||
|
|
Loading…
Reference in New Issue