Skip to content

Lower the Cloudflare header size test to 10,000 chars - #2830

Merged
hahn-kev merged 1 commit into
developfrom
claude/zealous-hofstadter-8440e2
Oct 28, 2026
Merged

hahn-kev merged 1 commit into
developfrom
claude/zealous-hofstadter-8440e2

Conversation

@hahn-kev-bot

Copy link
Copy Markdown
Collaborator

AI summary

HeaderTests.CheckCloudflareHeaderSizeLimit sometimes fails with a 520 from staging. The header it sends (10,195 chars) sits right on Cloudflare's size limit.

  • Whether a header goes over the limit depends on its contents, not just its length. In October 2026, 1 in 140 random 10,195-character headers got a 520. That header failed on every resend, over HTTP/1.1 and HTTP/2, and passed once cut to 10,175 characters.
  • Retrying wouldn't help: ApiTestBase's HttpClient already retries 5xx responses 3 times, and the failing run got four 520s in a row.
  • The test now sends 10,000 characters. None of 80 random headers failed at that size, and the test still leaves about 1,000 characters of headroom over LexAuthUser.MaxJwtLength (9,000).
  • The comment in the test records the new measurements.

Test plan

  • Testing project builds
  • Sent random headers to staging's public /api/healthz with curl: 10,195 failed 1 of 140; 10,100 and 10,000 failed 0 of 80 each
  • GHA integration tests / dotnet passes in CI

🤖 Generated with Claude Code

Whether a header goes over Cloudflare's size limit depends on its
contents, not just its length. At 10,195 characters about 1 in 140 random
headers got a 520 on every resend, so the test failed now and then. At
10,000 none of 80 failed, and the test still leaves about 1,000 characters
of headroom over LexAuthUser.MaxJwtLength.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the 📦 Lexbox issues related to any server side code, fw-headless included label Oct 27, 2026
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9863da18-b81c-47e7-843b-af90425d8ce1
Commits

Reviewing files that changed from the base of the PR and between cc4e892 and bb001cc.

Files selected for processing: 1
  • backend/Testing/ApiTests/HeaderTests.cs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

The integration test now records October 2026 header-size observations and notes that outcomes vary with header content. It tests a header size of 10,000 instead of 10,195. The test still sends 10 requests and expects each response to be OK.

Priority: Low

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix

Suggested reviewers: myieye

Merge Risk: Minimal · up to bb001

The test adjustment is mergeable with no actionable current-head risk identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within survi… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description check Passed The description clearly explains the intermittent Cloudflare 520 failures, the new 10,000-character limit, the supporting measurements, and the test plan.
Title check Passed The title clearly and concisely states the primary change: lowering the Cloudflare header size test to 10,000 characters.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit checks the headers with care,
Ten thousand bytes travel through the air.
Ten requests hop along the test,
Each OK response earns a rest.
Fresh notes mark what contents may do,
Then bunny bounds off, pleased and true.

Comment @coderabbitai help to get the list of available commands.

@hahn-kev
hahn-kev merged commit ac7caf3 into develop Oct 28, 2026
23 checks passed
@hahn-kev
hahn-kev deleted the claude/zealous-hofstadter-8440e2 branch October 28, 2026 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📦 Lexbox issues related to any server side code, fw-headless included

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants