@web/cors
v1.0.0
MIT
.cap
✓ Verified by capdux.org
AI-First .d.cp
Official CORS middleware plugin for cap:web (preflight OPTIONS, origin allowlist, credentials, exposed headers)
Install with Cap
$ cap add @web/cors
AI Interface Stub .d.cp
// Type definitions for CP
import { App, AppMethod, Context, Response, Plugin, PluginScope } from "../../../../lib/web/app.cp";
export class CorsConfig {
allow_origin: string,
allow_methods: string,
allow_headers: string,
expose_headers: string,
allow_credentials: bool,
max_age: string,
}
export fn corsHasCtlOrCrlf(s: string): bool;
export fn corsBytesEql(a: string, b: string): bool;
export fn isOriginAllowed(allow_origin: string, origin: string): bool;
export fn applyCorsHeaders(ctx: &mut Context, origin: string);
export fn corsOnRequest(ctx: &mut Context): bool;
export fn createCorsPlugin(cfg: CorsConfig): Plugin;
export fn registerCors(app: &mut App, cfg: CorsConfig): &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 · 2.4 KB | sha256-f68bacb5287ef4c9… | 0 | 2026-11-26 | latest |