Skip to content

🐛 bug: Fix ARMv7 build overflow in etag middleware#4190

Merged
ReneWerner87 merged 2 commits into
mainfrom
claude/fix-fiber-v3-middleware-build-armv7
Apr 6, 2026
Merged

🐛 bug: Fix ARMv7 build overflow in etag middleware#4190
ReneWerner87 merged 2 commits into
mainfrom
claude/fix-fiber-v3-middleware-build-armv7

Conversation

@Claude

@Claude Claude AI commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@Claude Claude AI assigned Claude and gaby Apr 6, 2026
@Claude Claude AI linked an issue Apr 6, 2026 that may be closed by this pull request
3 tasks
@ReneWerner87 ReneWerner87 added this to v3 Apr 6, 2026
@ReneWerner87 ReneWerner87 added this to the v3 milestone Apr 6, 2026
Cast math.MaxUint32 to uint64 to prevent integer overflow on 32-bit ARM platforms

Agent-Logs-Url: https://github.com/gofiber/fiber/sessions/44b365ec-92b2-4ef3-b17a-20aad6c316d0

Co-authored-by: gaby <835733+gaby@users.noreply.github.com>
@Claude Claude AI changed the title [WIP] Fix Fiber v3 middleware overflow issue on armv7 🐛 bug: Fix ARMv7 build overflow in etag middleware Apr 6, 2026
@Claude Claude AI requested a review from gaby April 6, 2026 14:18
Claude finished work on behalf of gaby April 6, 2026 14:18
@codecov

codecov Bot commented Apr 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.23%. Comparing base (7376f58) to head (250fabe).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
middleware/etag/etag.go 0.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4190      +/-   ##
==========================================
+ Coverage   91.18%   91.23%   +0.05%     
==========================================
  Files         123      123              
  Lines       11847    11847              
==========================================
+ Hits        10803    10809       +6     
+ Misses        658      653       -5     
+ Partials      386      385       -1     
Flag Coverage Δ
unittests 91.23% <0.00%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gaby

gaby commented Apr 6, 2026

Copy link
Copy Markdown
Member

@claude[agent] check the code base to see if this fix is needed anywhere else.

@Claude

Claude AI commented Apr 6, 2026

Copy link
Copy Markdown
Contributor Author

@claude[agent] check the code base to see if this fix is needed anywhere else.

I checked the entire codebase for similar issues. All other uses of math.Max* constants with uint64 comparisons are safe because they use explicit type conversions (e.g., uint64(math.MaxInt64)). The etag middleware was the only place where math.MaxUint32 was used in a comparison without explicit casting, causing the ARMv7 overflow. No additional fixes needed.

@Claude Claude AI changed the title 🐛 bug: Fix ARMv7 build overflow in etag middleware Addressing PR comments Apr 6, 2026
Claude finished work on behalf of gaby April 6, 2026 15:04
@gaby gaby marked this pull request as ready for review April 6, 2026 15:08
@gaby gaby requested a review from a team as a code owner April 6, 2026 15:08

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.

Pull request overview

This PR updates ETag middleware length checks to make the math.MaxUint32 comparison explicitly uint64-typed, aligning both sides of the comparison.

Changes:

  • Cast math.MaxUint32 to uint64 in Generate to keep the overflow guard type-consistent.
  • Cast math.MaxUint32 to uint64 in the middleware handler’s body-length guard before computing the ETag.

@gaby gaby changed the title Addressing PR comments 🐛 bug: Fix ARMv7 build overflow in etag middleware Apr 6, 2026
@ReneWerner87 ReneWerner87 merged commit 676b2f7 into main Apr 6, 2026
31 of 32 checks passed
@ReneWerner87 ReneWerner87 deleted the claude/fix-fiber-v3-middleware-build-armv7 branch April 6, 2026 15:19
@github-project-automation github-project-automation Bot moved this to Done in v3 Apr 6, 2026
@welcome

welcome Bot commented Apr 6, 2026

Copy link
Copy Markdown

Congrats on merging your first pull request! 🎉 We here at Fiber are proud of you! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

🐛 [Bug]: Fiber v3 middleware does not build on armv7

4 participants