Expose header parsing error variables#2096
Merged
erikdubbelboer merged 2 commits intovalyala:masterfrom Nov 12, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refactors internal error variables to exported error variables, making them part of the public API. This allows API consumers to perform error checking and matching against specific error conditions.
- All internal error variables (
errNeedMore,errSmallBuffer,errNonNumericChars) are converted to exported versions with PascalCase naming - Multiple new exported error variables are introduced for various parsing and validation scenarios
- All references throughout the codebase are updated to use the new exported error names
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| header.go | Consolidates all error variable declarations into a single exported var block; updates all internal references to use new exported error names |
| headerscanner.go | Updates error assignment to use exported ErrNeedMore |
| server.go | Updates error comparison to use exported ErrNeedMore |
| server_test.go | Updates test to use exported ErrSmallReadBuffer |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
|
👍 for this |
Collaborator
|
Thanks! |
Contributor
Author
|
Just wanted to prevent such situations, not that you change the error messages and we are then outdated. https://github.com/gofiber/fiber/blob/19cc3f56f09fa758fc6863c67c3747d6639029c2/app.go#L1327 |
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.
Summary