Skip to content

fix: disable restana default security headers - #477

Merged
Fdawgs merged 1 commit into
mainfrom
fix-restana-security-headers
Sep 1, 2026
Merged

fix: disable restana default security headers#477
Fdawgs merged 1 commit into
mainfrom
fix-restana-security-headers

Conversation

@mcollina

Copy link
Copy Markdown
Member

What

Pass securityHeaders: false to restana() in the restana benchmark.

Why

restana v6 adds three security headers by default (x-content-type-options: nosniff, x-frame-options: DENY, x-xss-protection: 0), sending ~77 extra bytes per response. No other framework in the suite sends these, so restana's response was 264 B vs the common 187 B baseline, inflating its throughput (MB/s) column relative to its req/s (12.01 MB/s at 47.7k req/s in the latest run, vs ~8.4 MB/s for node-http at a similar rate).

With the option disabled, restana's response is byte-identical to the node-http baseline (verified with curl -D -).

Notes from the investigation

The other throughput outliers (srvx, hono, elysia, h3) send content-type: application/json without ; charset=utf-8 — 15–17 fewer bytes than the baseline. That was deliberately left as-is: the missing bytes are spec-correct for JSON (RFC 8259) and measurably don't affect req/s or latency (A/B on node-http with only the header string changed lands within noise), while forcing the header per request knocks those frameworks off their precomputed-header fast paths, costing them 6–10% req/s. So their req/s numbers are honest; only the MB/s column reads slightly low for them.

🤖 Generated with Claude Code

https://claude.ai/code/session_013UMESZhv5Bv7rkAgcqbuHa

restana v6 adds x-content-type-options, x-frame-options and
x-xss-protection by default, sending ~77 extra bytes per response.
No other framework in the benchmark sends these, so its throughput
column was inflated relative to its req/s. Disable them so the
response matches the common 187-byte baseline.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013UMESZhv5Bv7rkAgcqbuHa
@Fdawgs
Fdawgs merged commit 244929a into main Sep 1, 2026
11 checks passed
@Fdawgs
Fdawgs deleted the fix-restana-security-headers branch September 1, 2026 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants