Skip to content

fix: reject repeated x-rendering-proxy headers#1658

Merged
kitsuyui merged 1 commit into
mainfrom
fix/audit-implicit-behavior-audit-002
Jul 18, 2026
Merged

fix: reject repeated x-rendering-proxy headers#1658
kitsuyui merged 1 commit into
mainfrom
fix/audit-implicit-behavior-audit-002

Conversation

@kitsuyui

Copy link
Copy Markdown
Owner

Summary

  • reject repeated X-Rendering-Proxy request header values instead of concatenating them implicitly
  • document that the server accepts a single JSON object header value for X-Rendering-Proxy
  • cover the repeated-header case with a parser test

Why

The protocol documentation already describes X-Rendering-Proxy as a single JSON object. Rejecting repeated header values makes the server behavior deterministic and avoids relying on implicit string concatenation for duplicate headers.

Validation

  • bun run lint
  • bun run typecheck
  • bun run test

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown

Code Metrics Report

main (6aabcd3) #1658 (c3767e7) +/-
Coverage 84.3% 84.4% +0.1%
Code to Test Ratio 1:0.5 1:0.5 -0.1
Test Execution Time 11s 8s -3s
Details
  |                     | main (6aabcd3) | #1658 (c3767e7) |  +/-  |
  |---------------------|----------------|-----------------|-------|
+ | Coverage            |          84.3% |           84.4% | +0.1% |
  |   Files             |             11 |              11 |     0 |
  |   Lines             |            243 |             245 |    +2 |
+ |   Covered           |            205 |             207 |    +2 |
- | Code to Test Ratio  |          1:0.5 |           1:0.5 |  -0.1 |
  |   Code              |           1886 |            1905 |   +19 |
+ |   Test              |           1072 |            1080 |    +8 |
+ | Test Execution Time |            11s |              8s |   -3s |

Code coverage of files in pull request scope (95.6% → 96.0%)

Files Coverage +/- Status
src/server/request_options.ts 96.0% +0.3% modified

Reported by octocov

Align the server behavior with the documented single-header protocol so duplicate header inputs fail deterministically instead of being concatenated implicitly.
@kitsuyui
kitsuyui force-pushed the fix/audit-implicit-behavior-audit-002 branch from d844beb to 9ee5407 Compare July 17, 2026 14:42
@github-actions

Copy link
Copy Markdown

gh-counter

PR gate

Removed Added +/-
TODO/expect-error 0 0 0

Repo dashboard

main (6aabcd3) #1658 (c3767e7) +/-
TODO/expect-error 4 4 0

Reported by gh-counter

@kitsuyui
kitsuyui merged commit f686c49 into main Jul 18, 2026
10 checks passed
@kitsuyui
kitsuyui deleted the fix/audit-implicit-behavior-audit-002 branch July 18, 2026 05:44
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.

1 participant