@blamejs/core 0.7.47 → 0.7.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -8,6 +8,10 @@ upgrading across more than a few patches at a time.
8
8
 
9
9
  ## v0.7.x
10
10
 
11
+ - **0.7.49** (2026-05-05) — `b.middleware.headers(opts)` — inbound HTTP header threat-detection middleware. Sits at the top of the request lifecycle. Threat catalog: `header-name-shape` (header name not a valid RFC 9110 §5.1 token); `header-value-control-byte` (CR / LF / NUL inside any header value — header-injection defense in depth on top of Node's rejection); `header-count-cap` (default 100 inbound headers max); `header-value-cap` (default 8 KiB per value); `smuggling-cl-te` (RFC 9112 §6.1 — both Content-Length and Transfer-Encoding present, the canonical CL.TE / TE.CL request-smuggling vector); `smuggling-cl-multi` / `smuggling-te-multi` (multiple values for either header — proxy-desync class); `deprecated-trust-header` (X-Forwarded-For / -Proto / -Host / -Port / X-Real-IP present without operator-supplied `trustProxy: true` opt — operators should adopt RFC 7239 `Forwarded`). On `mode: "enforce"` + `refuseOnHigh` (default), refuses with HTTP 400 + JSON body listing detected high-severity issues; emits one audit row per issue regardless of mode. Complements the existing per-route smuggling defense in `b.middleware.bodyParser` by running the same check at the top of the chain (covers GET / HEAD requests that don't body-parse).
12
+
13
+ - **0.7.48** (2026-05-05) — `b.cookies.parseSafe(header, opts)` + `b.middleware.cookies(opts)` — inbound cookie-header threat detection. The existing `b.cookies.parse` is lenient (last-write-wins, silent skip on malformed pairs); `parseSafe` returns `{ jar, issues }` and surfaces every detected anomaly: header-cap (oversized Cookie header), header-control-byte (CR / LF / NUL injected through proxy — header-injection prelude class), pair-malformed (missing `=`), pair-empty-name, name-cap (oversized name), value-cap (oversized value), duplicate-name (cookie-tossing class — same name appearing more than once in one Cookie header indicates an attacker-set parent-domain cookie shadowing the legitimate one). The middleware shape (`b.middleware.cookies({ mode, audit, refuseOnHigh })`) wires `parseSafe` into the request lifecycle: populates `req.cookieJar`, emits one audit row per detected issue, and refuses with HTTP 400 on any high-severity issue when `mode: "enforce"` (default). Existing `b.cookies` invariants (RFC 6265bis token grammar enforcement, `__Host-` / `__Secure-` prefix invariants, SameSite=None requires Secure, `Partitioned` / CHIPS attribute support, length caps on serialize-side) remain unchanged — this slice closes the inbound-detection gap.
14
+
11
15
  - **0.7.47** (2026-05-05) — `b.guardMime` — RFC 6838 media-type identifier-safety primitive (KIND="identifier"). Validates user-supplied media type strings destined for Accept-shape comparison, content-type allowlists, and dispatch routing. Threat catalog: shape malformation (missing `/`, bad type/subtype tokens against RFC 6838 §4.2 restricted-name grammar); parameter validation against the RFC 7231 §3.1.1.1 tchar token grammar (token-only or quoted-string per RFC 7230 §3.2.6); wildcard (`type/subtype` with `*`) outside Accept context refuse; vendor tree (`vnd.*`), personal tree (`prs.*`), and unregistered (`x.*` / `x-*`) namespace audit so operators audit those slots; risky-type refuse list covering executable + script-host content types (`application/x-msdownload`, `application/x-bat`, `application/x-msdos-program`, `application/x-sh`, `application/x-csh`, `application/x-perl`, `application/x-python`, `application/javascript`, `application/x-javascript`, `text/javascript`, `text/x-javascript`, `application/x-shockwave-flash`, `application/x-msi`); BIDI / zero-width / control / null-byte universal refuse. `sanitize` lowercases type/subtype while preserving parameter case (multipart boundary tokens etc. are case-significant). Profiles: `strict` (refuse wildcard + risky-type, audit trees + parameters), `balanced` (audit most things, allow vendor tree), `permissive` (universal-refuse class still refused). Postures: `hipaa` / `pci-dss` / `soc2` strict overlay; `gdpr` balanced overlay. Auto-registers into `b.guardAll` as a STANDALONE_GUARD.
12
16
 
13
17
  - **0.7.46** (2026-05-05) — `b.guardTime` — RFC 3339 / ISO 8601 datetime identifier-safety primitive (KIND="identifier"). Validates user-supplied datetime strings destined for audit timestamps, scheduling, retention windows, query ranges, and cross-system event correlation. Threat catalog: shape malformation against the RFC 3339 §5.6 grammar; year-window overflow (default `[1970, 9999]`); naive datetime (no offset) refuse; non-UTC offset policy (strict requires `Z` / `+00:00`); leap-second `60` field policy (RFC 3339 §5.6 valid but parser-panic prone); excessive fractional precision cap (default 9 digits / nanoseconds); date-only and time-only refuse for full-datetime contexts; structural range violations (month / day-in-month / hour / minute / second); BIDI / zero-width / control / null-byte universal refuse. `sanitize` normalizes a space date/time separator to `T` and uppercases the trailing `z` UTC marker. Profiles: `strict` (refuse all of the above), `balanced` (refuse naive; audit non-UTC + leap + fractional + date/time-only), `permissive` (universal-refuse class still refused). Postures: `hipaa` / `pci-dss` / `soc2` strict overlay; `gdpr` balanced overlay. Auto-registers into `b.guardAll` as a STANDALONE_GUARD.
package/lib/cookies.js CHANGED
@@ -342,9 +342,126 @@ function create(opts) {
342
342
  };
343
343
  }
344
344
 
345
+ // parseSafe — threat-detecting inbound-cookie parser. Returns
346
+ // { jar, issues } where every detected anomaly surfaces as an issue
347
+ // instead of being silently dropped (as the lenient parse() does).
348
+ //
349
+ // Threat catalog applied to the inbound Cookie header:
350
+ // - Oversized header — total bytes exceed maxHeaderBytes (default 8 KiB).
351
+ // - Oversized pair — name + value exceeds NAME_LENGTH + VALUE_LENGTH cap.
352
+ // - Duplicate cookie name — RFC 6265 last-write-wins is the browser
353
+ // behavior, but two pairs with the same name in one Cookie header
354
+ // usually indicates cookie-tossing (attacker-set parent-domain
355
+ // cookie shadowing the legitimate one).
356
+ // - Malformed pair — missing `=` or empty name.
357
+ // - Forbidden chars in raw header — CR / LF / NUL injected through
358
+ // a downstream proxy.
359
+ // - Empty / non-string input — operator-misuse signal.
360
+ //
361
+ // Issue shape: { kind, severity: "high"|"warn", snippet, name? }.
362
+ //
363
+ // Operators wire it through `b.middleware.cookies` (the convenience
364
+ // middleware below) or call directly when they want the issues list
365
+ // without imposing a request lifecycle.
366
+ function parseSafe(cookieHeader, opts) {
367
+ opts = opts || {};
368
+ var maxHeaderBytes = opts.maxHeaderBytes || C.BYTES.kib(8);
369
+ var maxNameBytes = opts.maxNameBytes || MAX_NAME_LENGTH;
370
+ var maxValueBytes = opts.maxValueBytes || MAX_VALUE_LENGTH;
371
+
372
+ if (typeof cookieHeader !== "string") {
373
+ return {
374
+ jar: {},
375
+ issues: [{ kind: "bad-input", severity: "high",
376
+ snippet: "cookie header is not a string" }],
377
+ };
378
+ }
379
+ if (cookieHeader.length === 0) return { jar: {}, issues: [] };
380
+
381
+ var issues = [];
382
+ var jar = Object.create(null);
383
+ var seen = Object.create(null);
384
+
385
+ if (Buffer.byteLength(cookieHeader, "utf8") > maxHeaderBytes) {
386
+ issues.push({
387
+ kind: "header-cap", severity: "high",
388
+ snippet: "Cookie header " + cookieHeader.length + " bytes exceeds " +
389
+ "maxHeaderBytes " + maxHeaderBytes,
390
+ });
391
+ return { jar: jar, issues: issues };
392
+ }
393
+ for (var hi = 0; hi < cookieHeader.length; hi += 1) {
394
+ var ch = cookieHeader.charCodeAt(hi);
395
+ if (ch === 0x0D || ch === 0x0A || ch === 0x00) { // allow:raw-byte-literal — CR / LF / NUL forbidden in cookie header
396
+ issues.push({
397
+ kind: "header-control-byte", severity: "high",
398
+ snippet: "Cookie header contains CR / LF / NUL — proxy-side " +
399
+ "header injection vector",
400
+ });
401
+ return { jar: jar, issues: issues };
402
+ }
403
+ }
404
+
405
+ var pairs = cookieHeader.split(/;\s*/);
406
+ for (var i = 0; i < pairs.length; i += 1) {
407
+ var pair = pairs[i];
408
+ if (!pair) continue;
409
+ var eq = pair.indexOf("=");
410
+ if (eq < 0) {
411
+ issues.push({
412
+ kind: "pair-malformed", severity: "warn",
413
+ snippet: "cookie pair " + JSON.stringify(pair) + " missing `=`",
414
+ });
415
+ continue;
416
+ }
417
+ var k = pair.slice(0, eq).trim();
418
+ if (!k) {
419
+ issues.push({
420
+ kind: "pair-empty-name", severity: "warn",
421
+ snippet: "cookie pair has empty name",
422
+ });
423
+ continue;
424
+ }
425
+ var v = pair.slice(eq + 1).trim();
426
+ if (v.length >= 2 && v.charAt(0) === '"' && v.charAt(v.length - 1) === '"') {
427
+ v = v.slice(1, -1);
428
+ }
429
+ try { v = decodeURIComponent(v); }
430
+ catch (_e) { /* malformed encoding — keep raw */ }
431
+
432
+ if (Buffer.byteLength(k, "utf8") > maxNameBytes) {
433
+ issues.push({
434
+ kind: "name-cap", severity: "high", name: k,
435
+ snippet: "cookie name exceeds maxNameBytes " + maxNameBytes,
436
+ });
437
+ continue;
438
+ }
439
+ if (Buffer.byteLength(v, "utf8") > maxValueBytes) {
440
+ issues.push({
441
+ kind: "value-cap", severity: "high", name: k,
442
+ snippet: "cookie `" + k + "` value exceeds maxValueBytes " +
443
+ maxValueBytes,
444
+ });
445
+ continue;
446
+ }
447
+ if (seen[k]) {
448
+ issues.push({
449
+ kind: "duplicate-name", severity: "high", name: k,
450
+ snippet: "cookie name `" + k + "` appears more than once — " +
451
+ "browser last-write-wins; cookie-tossing class " +
452
+ "(parent-domain cookie shadowing the legitimate one)",
453
+ });
454
+ }
455
+ seen[k] = true;
456
+ jar[k] = v;
457
+ }
458
+ return { jar: jar, issues: issues };
459
+ }
460
+
345
461
  module.exports = {
346
462
  create: create,
347
463
  parse: parse,
464
+ parseSafe: parseSafe,
348
465
  serialize: serialize,
349
466
  CookieError: CookieError,
350
467
  };
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ /**
3
+ * b.middleware.cookies — inbound cookie-header threat detection.
4
+ *
5
+ * Sits in the request lifecycle and runs `b.cookies.parseSafe` against
6
+ * the inbound `Cookie` header. Threat detection always-on; the gate
7
+ * either refuses, audits, or logs the detected anomalies based on the
8
+ * operator's `mode`.
9
+ *
10
+ * Threats surfaced (see lib/cookies.js parseSafe):
11
+ * - header-cap — Cookie header exceeds maxHeaderBytes
12
+ * - header-control-byte — CR / LF / NUL injected through proxy
13
+ * - pair-malformed — pair missing `=`
14
+ * - pair-empty-name — empty name
15
+ * - name-cap — cookie name exceeds maxNameBytes
16
+ * - value-cap — cookie value exceeds maxValueBytes
17
+ * - duplicate-name — name appears >1 time (cookie-tossing class)
18
+ *
19
+ * Side effects:
20
+ * - req.cookieJar — populated with the parsed jar (overwriteable)
21
+ * - audit emission — one row per detected high-severity issue
22
+ * - response — refused requests get HTTP 400 + JSON body
23
+ *
24
+ * var middleware = b.middleware.cookies({
25
+ * mode: "enforce", // "enforce" | "audit-only" | "log-only"
26
+ * audit: b.audit,
27
+ * maxHeaderBytes: 8 * 1024,
28
+ * refuseOnHigh: true, // 400 if any high-severity issue
29
+ * });
30
+ */
31
+
32
+ var cookies = require("../cookies");
33
+ var lazyRequire = require("../lazy-require");
34
+
35
+ var observability = lazyRequire(function () { return require("../observability"); });
36
+ void observability;
37
+
38
+ function _emitAudit(audit, action, outcome, metadata) {
39
+ if (!audit || typeof audit.safeEmit !== "function") return;
40
+ try {
41
+ audit.safeEmit({
42
+ action: action,
43
+ actor: metadata.actor || { kind: "framework", id: "middleware/cookies" },
44
+ outcome: outcome,
45
+ metadata: metadata,
46
+ });
47
+ } catch (_e) { /* drop-silent — observability sink */ }
48
+ }
49
+
50
+ function create(opts) {
51
+ opts = opts || {};
52
+ var mode = opts.mode || "enforce";
53
+ var refuseOnHigh = opts.refuseOnHigh !== false && mode === "enforce";
54
+ var maxHeaderBytes = opts.maxHeaderBytes;
55
+ var maxNameBytes = opts.maxNameBytes;
56
+ var maxValueBytes = opts.maxValueBytes;
57
+ var audit = opts.audit || null;
58
+
59
+ return function cookiesMiddleware(req, res, next) {
60
+ var header = req && req.headers ? req.headers.cookie : "";
61
+ var rv = cookies.parseSafe(header || "", {
62
+ maxHeaderBytes: maxHeaderBytes,
63
+ maxNameBytes: maxNameBytes,
64
+ maxValueBytes: maxValueBytes,
65
+ });
66
+ req.cookieJar = rv.jar;
67
+
68
+ if (rv.issues.length === 0) return next();
69
+
70
+ var hasHigh = false;
71
+ for (var i = 0; i < rv.issues.length; i += 1) {
72
+ var iss = rv.issues[i];
73
+ if (iss.severity === "high") hasHigh = true;
74
+ _emitAudit(audit, "middleware.cookies.threat-detected",
75
+ iss.severity === "high" ? "blocked" : "audit", {
76
+ kind: iss.kind,
77
+ name: iss.name || null,
78
+ snippet: iss.snippet,
79
+ mode: mode,
80
+ });
81
+ }
82
+
83
+ if (hasHigh && refuseOnHigh) {
84
+ res.statusCode = 400;
85
+ res.setHeader("Content-Type", "application/json");
86
+ res.end(JSON.stringify({
87
+ error: "cookie-threat-detected",
88
+ issues: rv.issues.map(function (i) {
89
+ return { kind: i.kind, severity: i.severity };
90
+ }),
91
+ }));
92
+ return;
93
+ }
94
+ return next();
95
+ };
96
+ }
97
+
98
+ module.exports = { create: create };
@@ -0,0 +1,206 @@
1
+ "use strict";
2
+ /**
3
+ * b.middleware.headers — inbound HTTP header threat detection.
4
+ *
5
+ * Sits at the top of the request lifecycle. Validates the inbound
6
+ * headers against the RFC 9110 §5.1 token grammar and surfaces threat
7
+ * shapes: CRLF injection, CL+TE request smuggling (RFC 9112 §6.1),
8
+ * oversized header / count, deprecated trust-header patterns.
9
+ *
10
+ * Threat catalog:
11
+ * - header-name-shape — header name not a valid RFC 9110 token.
12
+ * - header-value-control-byte — CR / LF / NUL inside a header value
13
+ * (header-injection defense in depth on top of Node's rejection).
14
+ * - header-count-cap — > maxHeaderCount headers (default 100).
15
+ * - header-value-cap — single value > maxValueBytes (default 8 KiB).
16
+ * - smuggling-cl-te — Content-Length AND Transfer-Encoding both
17
+ * present (RFC 9112 §6.1 — CL.TE / TE.CL smuggling shape).
18
+ * - smuggling-cl-multi — multiple Content-Length values (proxy-
19
+ * desync class).
20
+ * - smuggling-te-multi — multiple Transfer-Encoding values.
21
+ * - deprecated-trust-header — X-Forwarded-For / X-Forwarded-Proto /
22
+ * X-Forwarded-Host present without operator-supplied trustProxy
23
+ * opt — the framework warns once that the operator should adopt
24
+ * RFC 7239 `Forwarded` or explicit trustProxy.
25
+ *
26
+ * var middleware = b.middleware.headers({
27
+ * mode: "enforce", // "enforce" | "audit-only" | "log-only"
28
+ * audit: b.audit,
29
+ * maxHeaderCount: 100,
30
+ * maxValueBytes: 8 * 1024,
31
+ * trustProxy: false, // whether X-Forwarded-* is allowed
32
+ * refuseOnHigh: true,
33
+ * });
34
+ */
35
+
36
+ var lazyRequire = require("../lazy-require");
37
+
38
+ var observability = lazyRequire(function () { return require("../observability"); });
39
+ void observability;
40
+
41
+ // RFC 9110 §5.1 token grammar — tchar set.
42
+ var TOKEN_RE = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
43
+
44
+ var DEPRECATED_TRUST_HEADERS = Object.freeze([
45
+ "x-forwarded-for",
46
+ "x-forwarded-proto",
47
+ "x-forwarded-host",
48
+ "x-forwarded-port",
49
+ "x-real-ip",
50
+ ]);
51
+
52
+ function _emitAudit(audit, action, outcome, metadata) {
53
+ if (!audit || typeof audit.safeEmit !== "function") return;
54
+ try {
55
+ audit.safeEmit({
56
+ action: action,
57
+ actor: metadata.actor || { kind: "framework", id: "middleware/headers" },
58
+ outcome: outcome,
59
+ metadata: metadata,
60
+ });
61
+ } catch (_e) { /* drop-silent — observability sink */ }
62
+ }
63
+
64
+ function _detectIssues(headers, opts) {
65
+ var issues = [];
66
+ if (!headers || typeof headers !== "object") return issues;
67
+
68
+ var names = Object.keys(headers);
69
+
70
+ if (names.length > opts.maxHeaderCount) {
71
+ issues.push({
72
+ kind: "header-count-cap", severity: "high",
73
+ snippet: "request has " + names.length + " headers, exceeds " +
74
+ "maxHeaderCount " + opts.maxHeaderCount,
75
+ });
76
+ }
77
+
78
+ for (var i = 0; i < names.length; i += 1) {
79
+ var name = names[i];
80
+ var value = headers[name];
81
+
82
+ // Header name shape — Node lowercases names; the original tchar
83
+ // grammar covers a-z / 0-9 / `!#$%&'*+-.^_`|~`.
84
+ if (!TOKEN_RE.test(name)) { // allow:regex-no-length-cap — Node already caps header name length at 8190 chars by default (HTTP/1.1 line cap)
85
+ issues.push({
86
+ kind: "header-name-shape", severity: "high",
87
+ snippet: "header name `" + name + "` is not a valid RFC 9110 " +
88
+ "§5.1 token",
89
+ });
90
+ }
91
+
92
+ var valueArr = Array.isArray(value) ? value : [value];
93
+ for (var vi = 0; vi < valueArr.length; vi += 1) {
94
+ var v = valueArr[vi];
95
+ if (typeof v !== "string") continue;
96
+ if (Buffer.byteLength(v, "utf8") > opts.maxValueBytes) {
97
+ issues.push({
98
+ kind: "header-value-cap", severity: "high", header: name,
99
+ snippet: "header `" + name + "` value " + v.length +
100
+ " bytes exceeds maxValueBytes " + opts.maxValueBytes,
101
+ });
102
+ continue;
103
+ }
104
+ for (var ci = 0; ci < v.length; ci += 1) {
105
+ var cc = v.charCodeAt(ci);
106
+ if (cc === 0x0D || cc === 0x0A || cc === 0x00) { // allow:raw-byte-literal — CR / LF / NUL forbidden in header value
107
+ issues.push({
108
+ kind: "header-value-control-byte", severity: "high", header: name,
109
+ snippet: "header `" + name + "` value contains CR / LF / NUL " +
110
+ "— header-injection defense in depth",
111
+ });
112
+ break;
113
+ }
114
+ }
115
+ }
116
+ }
117
+
118
+ // Smuggling shapes (RFC 9112 §6.1).
119
+ var clRaw = headers["content-length"];
120
+ var teRaw = headers["transfer-encoding"];
121
+ if (clRaw !== undefined && teRaw !== undefined) {
122
+ issues.push({
123
+ kind: "smuggling-cl-te", severity: "high",
124
+ snippet: "both Content-Length and Transfer-Encoding present " +
125
+ "(RFC 9112 §6.1 — CL.TE / TE.CL request-smuggling vector)",
126
+ });
127
+ }
128
+ if (Array.isArray(clRaw) && clRaw.length > 1) {
129
+ issues.push({
130
+ kind: "smuggling-cl-multi", severity: "high",
131
+ snippet: "multiple Content-Length values — proxy-desync " +
132
+ "request-smuggling vector",
133
+ });
134
+ }
135
+ if (Array.isArray(teRaw) && teRaw.length > 1) {
136
+ issues.push({
137
+ kind: "smuggling-te-multi", severity: "high",
138
+ snippet: "multiple Transfer-Encoding values — proxy-desync " +
139
+ "request-smuggling vector",
140
+ });
141
+ }
142
+
143
+ // Deprecated trust-header pattern.
144
+ if (!opts.trustProxy) {
145
+ for (var di = 0; di < DEPRECATED_TRUST_HEADERS.length; di += 1) {
146
+ var h = DEPRECATED_TRUST_HEADERS[di];
147
+ if (headers[h] !== undefined) {
148
+ issues.push({
149
+ kind: "deprecated-trust-header", severity: "warn", header: h,
150
+ snippet: "request carries `" + h + "` but trustProxy is " +
151
+ "false — adopt RFC 7239 `Forwarded` or set " +
152
+ "trustProxy explicitly",
153
+ });
154
+ }
155
+ }
156
+ }
157
+
158
+ return issues;
159
+ }
160
+
161
+ function create(opts) {
162
+ opts = opts || {};
163
+ var mode = opts.mode || "enforce";
164
+ var refuseOnHigh = opts.refuseOnHigh !== false && mode === "enforce";
165
+ var audit = opts.audit || null;
166
+ var resolved = {
167
+ maxHeaderCount: opts.maxHeaderCount || 100, // allow:raw-byte-literal — header count ceiling
168
+ maxValueBytes: opts.maxValueBytes || 8 * 1024, // allow:raw-byte-literal — header value cap (8 KiB)
169
+ trustProxy: !!opts.trustProxy,
170
+ };
171
+
172
+ return function headersMiddleware(req, res, next) {
173
+ var headers = req && req.headers ? req.headers : {};
174
+ var issues = _detectIssues(headers, resolved);
175
+ if (issues.length === 0) return next();
176
+
177
+ var hasHigh = false;
178
+ for (var i = 0; i < issues.length; i += 1) {
179
+ var iss = issues[i];
180
+ if (iss.severity === "high") hasHigh = true;
181
+ _emitAudit(audit, "middleware.headers.threat-detected",
182
+ iss.severity === "high" ? "blocked" : "audit", {
183
+ kind: iss.kind,
184
+ header: iss.header || null,
185
+ snippet: iss.snippet,
186
+ mode: mode,
187
+ });
188
+ }
189
+
190
+ if (hasHigh && refuseOnHigh) {
191
+ res.statusCode = 400;
192
+ res.setHeader("Content-Type", "application/json");
193
+ res.end(JSON.stringify({
194
+ error: "header-threat-detected",
195
+ issues: issues.filter(function (i) { return i.severity === "high"; })
196
+ .map(function (i) {
197
+ return { kind: i.kind, header: i.header || null };
198
+ }),
199
+ }));
200
+ return;
201
+ }
202
+ return next();
203
+ };
204
+ }
205
+
206
+ module.exports = { create: create };
@@ -22,12 +22,14 @@ var bearerAuth = require("./bearer-auth");
22
22
  var bodyParser = require("./body-parser");
23
23
  var botGuard = require("./bot-guard");
24
24
  var compression = require("./compression");
25
+ var cookies = require("./cookies");
25
26
  var cors = require("./cors");
26
27
  var cspNonce = require("./csp-nonce");
27
28
  var csrfProtect = require("./csrf-protect");
28
29
  var dbRoleFor = require("./db-role-for");
29
30
  var errorHandler = require("./error-handler");
30
31
  var fetchMetadata = require("./fetch-metadata");
32
+ var headers = require("./headers");
31
33
  var health = require("./health");
32
34
  var networkAllowlist = require("./network-allowlist");
33
35
  var rateLimit = require("./rate-limit");
@@ -49,9 +51,11 @@ module.exports = {
49
51
  requireAuth: requireAuth.create,
50
52
  csrfProtect: csrfProtect.create,
51
53
  fetchMetadata: fetchMetadata.create,
54
+ headers: headers.create,
52
55
  bodyParser: bodyParser.create,
53
56
  health: health.create,
54
57
  compression: compression.create,
58
+ cookies: cookies.create,
55
59
  cspNonce: cspNonce.create,
56
60
  sse: sse.create,
57
61
  requestLog: requestLog.create,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blamejs/core",
3
- "version": "0.7.47",
3
+ "version": "0.7.49",
4
4
  "description": "The Node framework that owns its stack.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "blamejs contributors",
@@ -2,10 +2,10 @@
2
2
  "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
3
3
  "bomFormat": "CycloneDX",
4
4
  "specVersion": "1.5",
5
- "serialNumber": "urn:uuid:49f1481c-f876-4567-878c-2f709b99fd4f",
5
+ "serialNumber": "urn:uuid:edb0b995-1067-4678-bbbc-7072a4712f7a",
6
6
  "version": 1,
7
7
  "metadata": {
8
- "timestamp": "2026-05-05T21:48:20.338Z",
8
+ "timestamp": "2026-05-05T22:04:11.156Z",
9
9
  "lifecycles": [
10
10
  {
11
11
  "phase": "build"
@@ -19,14 +19,14 @@
19
19
  }
20
20
  ],
21
21
  "component": {
22
- "bom-ref": "@blamejs/core@0.7.47",
22
+ "bom-ref": "@blamejs/core@0.7.49",
23
23
  "type": "library",
24
24
  "name": "blamejs",
25
- "version": "0.7.47",
25
+ "version": "0.7.49",
26
26
  "scope": "required",
27
27
  "author": "blamejs contributors",
28
28
  "description": "The Node framework that owns its stack.",
29
- "purl": "pkg:npm/%40blamejs/core@0.7.47",
29
+ "purl": "pkg:npm/%40blamejs/core@0.7.49",
30
30
  "properties": [],
31
31
  "externalReferences": [
32
32
  {
@@ -54,7 +54,7 @@
54
54
  "components": [],
55
55
  "dependencies": [
56
56
  {
57
- "ref": "@blamejs/core@0.7.47",
57
+ "ref": "@blamejs/core@0.7.49",
58
58
  "dependsOn": []
59
59
  }
60
60
  ]