@web/multipart
v1.0.0
MIT
.cap
✓ Verified by capdux.org
AI-First .d.cp
Official multipart/form-data parser and payload guard plugin for cap:web
Install with Cap
$ cap add @web/multipart
AI Interface Stub .d.cp
// Type definitions for CP
import { App, AppMethod, Context, Response, Plugin, PluginScope } from "../../../../lib/web/app.cp";
export class MultipartConfig {
max_parts: usize,
max_file_bytes: usize,
max_total_bytes: usize,
allowed_mime_prefix: string,
}
export class MultipartPart {
name: string,
filename: string,
content_type: string,
data: string,
is_file: bool,
}
export class MultipartForm {
parts: [16]MultipartPart,
count: usize,
total_bytes: usize,
}
export fn mpAsciiLower(c: u8): u8;
export fn mpStartsWithIgnoreCase(s: string, prefix: string): bool;
export fn mpEqlIgnoreCase(a: string, b: string): bool;
export fn mpTrimSpaces(s: string): string;
export fn mpParseUsize(s: string): usize?;
export fn mpMatchAt(haystack: string, pos: usize, needle: string): bool;
export fn mpFindBoundary(body: string, start_pos: usize, boundary: string): usize?;
export fn mpFindHeaderEnd(part: string, body_start_out: &mut usize): usize?;
export fn mpExtractParam(header_val: string, key: string): string?;
export fn parseMultipartBody(boundary: string, body: string, cfg: MultipartConfig, out_form: &mut MultipartForm): i32;
export fn multipartGuardHook(ctx: &mut Context): bool;
export fn createMultipartPlugin(cfg: MultipartConfig): Plugin;
export fn registerMultipart(app: &mut App, cfg: MultipartConfig): &mut App;
README
MarkdownNo README provided for this package version.
Version History
1 release| Version | Format / Size | Integrity (SHA-256) | Downloads | Published | Status |
|---|---|---|---|---|---|
| v1.0.0 | .cap · 4.3 KB | sha256-48f1c49c1ea420d4… | 0 | 2026-11-26 | latest |