Skip to content

fix: cheaper header validator#1178

Open
ferhatelmas wants to merge 1 commit into
masterfrom
ferhat/cheaper-headers
Open

fix: cheaper header validator#1178
ferhatelmas wants to merge 1 commit into
masterfrom
ferhat/cheaper-headers

Conversation

@ferhatelmas

Copy link
Copy Markdown
Member

What kind of change does this PR introduce?

Refactoring for perf

What is the current behavior?

Header length validation is allocating a buffer.

What is the new behavior?

Merge header validator plugin and s3 header validation.
Replace regex with a for loop of char code, which is faster for shorter strings.
This approach enables counting at the same time to prevent buffer allocation and do only one pass.

Additional context

Handle empty values in user metadata but block empty key.
Add aws prefix into header length check.

Copilot AI review requested due to automatic review settings June 25, 2026 21:43
@ferhatelmas ferhatelmas requested a review from a team as a code owner June 25, 2026 21:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@blacksmith-sh

This comment has been minimized.

@coveralls

coveralls commented Jun 25, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 28202916763

Coverage decreased (-0.01%) to 78.805%

Details

  • Coverage decreased (-0.01%) from the base build.
  • Patch coverage: 50 of 50 lines across 4 files are fully covered (100%).
  • 18 coverage regressions across 2 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

18 previously-covered lines in 2 files lost coverage.

File Lines Losing Coverage Coverage
src/internal/http/agent.ts 17 32.56%
src/http/routes/s3/index.ts 1 82.99%

Coverage Stats

Coverage Status
Relevant Lines: 12182
Covered Lines: 10041
Line Coverage: 82.42%
Relevant Branches: 7025
Covered Branches: 5095
Branch Coverage: 72.53%
Branches in Coverage %: Yes
Coverage Strength: 421.74 hits per line

💛 - Coveralls

Signed-off-by: ferhat elmas <elmas.ferhat@gmail.com>
@ferhatelmas ferhatelmas force-pushed the ferhat/cheaper-headers branch from 220b559 to 6b2b9ea Compare June 25, 2026 21:54
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