fix: disable restana default security headers - #477
Merged
Conversation
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
approved these changes
Aug 31, 2026
Tony133
approved these changes
Sep 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Pass
securityHeaders: falsetorestana()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/jsonwithout; 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