We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MultipartReader truncates big files.
MultipartReader
version:
deno 0.41.0 v8 8.2.308 typescript 3.8.3
To reproduce run the following snippet:
import { serve } from "https://deno.land/std/http/server.ts"; import { MultipartReader } from "https://deno.land/std/mime/multipart.ts"; function getHeaderValueParams(value) { const params = new Map(); // Forced to do so for some Map constructor param mismatch value .split(";") .slice(1) .map((s) => s.trim().split("=")) .filter((arr) => arr.length > 1) .map(([k, v]) => [k, v.replace(/^"([^"]*)"$/, "$1")]) .forEach(([k, v]) => params.set(k, v)); return params; } const s = serve({ port: 8000 }); for await (const req of s) { const params = getHeaderValueParams(req.headers.get("content-type")) const reader = new MultipartReader(req.body, params.get('boundary')); const form = await reader.readForm(1 << 20) console.log(form.file('file')) req.respond({ body: 'deno' }); }
Any file with a size bigger than 11534332 bytes will get truncated.
11534332
truncate -s 12m 12m.file curl --location --request POST 'http://localhost:8000/' \ --form 'deno=land' \ --form 'file=@/home/marcos/12mb.file' # change file path
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
MultipartReader
truncates big files.version:
To reproduce run the following snippet:
Any file with a size bigger than
11534332
bytes will get truncated.The text was updated successfully, but these errors were encountered: