summaryrefslogtreecommitdiff
path: root/std/mime
diff options
context:
space:
mode:
Diffstat (limited to 'std/mime')
-rw-r--r--std/mime/multipart.ts4
-rw-r--r--std/mime/multipart_test.ts2
2 files changed, 3 insertions, 3 deletions
diff --git a/std/mime/multipart.ts b/std/mime/multipart.ts
index c46948226..709752290 100644
--- a/std/mime/multipart.ts
+++ b/std/mime/multipart.ts
@@ -308,7 +308,7 @@ export class MultipartReader {
}
// file
let formFile: FormFile | undefined;
- const n = await copy(buf, p);
+ const n = await copy(p, buf);
const contentType = p.headers.get("content-type");
assert(contentType != null, "content-type must be set");
if (n > maxMemory) {
@@ -573,7 +573,7 @@ export class MultipartWriter {
file: Reader
): Promise<void> {
const f = await this.createFormFile(field, filename);
- await copy(f, file);
+ await copy(file, f);
}
private flush(): Promise<void> {
diff --git a/std/mime/multipart_test.ts b/std/mime/multipart_test.ts
index 8b721a441..aa3b7524e 100644
--- a/std/mime/multipart_test.ts
+++ b/std/mime/multipart_test.ts
@@ -208,7 +208,7 @@ test({
assert(file.tempfile != null);
const f = await open(file.tempfile);
const w = new StringWriter();
- await copy(w, f);
+ await copy(f, w);
const json = JSON.parse(w.toString());
assertEquals(json["compilerOptions"]["target"], "es2018");
f.close();