-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
📚 Docs: Add c.Drop()
example to whats_new.md
#3285
Conversation
- Add Drop section with an example in `whats_new.md` - Reorder `c.Drop()` and `c.End()` to match source code order in `whats_new.md`
Warning Rate limit exceeded@gaby has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 28 minutes and 34 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughThe pull request introduces significant updates to the Fiber framework version 3, focusing on refactoring method signatures and enhancing framework functionality. The changes primarily affect the Changes
Assessment against linked issues
Possibly related PRs
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
docs/whats_new.md (2)
408-438
: LGTM! Documentation forDrop()
is clear and well-structured.The documentation effectively explains the purpose, use cases, and implementation of the
Drop()
function. The caution note about additional security measures is particularly valuable.Consider adding a note about error handling, specifically mentioning that
Drop()
returnsnil
and can be used with or without thereturn
statement:app.Get("/", func(c fiber.Ctx) error { if c.IP() == "192.168.1.1" { - return c.Drop() + c.Drop() // Both with or without return statement work + return nil } return c.SendString("Hello World!") })
Line range hint
439-476
: LGTM! Documentation forEnd()
is comprehensive and well-explained.The documentation effectively explains the purpose and usage of the
End()
function, particularly in the context of middleware chains.Consider adding a note about the order of operations when using
End()
withSendString
, specifically mentioning that the response is sent before the connection is closed:app.Get("/hello", func (c fiber.Ctx) error { query := c.Query("name", "") if query == "" { - c.SendString("You don't have a name?") - c.End() + c.SendString("You don't have a name?") // Response is sent first + c.End() // Then the connection is closed return errors.New("No name provided") } return c.SendString("Hello, " + query + "!") })
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 LGTM
Description
This PR adds a
Drop
section with an example inwhats_new.md
. It also reordersc.Drop()
andc.End()
inwhats_new.md
to match the source code order.Fixes #3282
Changes introduced
Type of change
Checklist
Before you submit your pull request, please make sure you meet these requirements:
/docs/
directory for Fiber's documentation.Commit formatting
Please use emojis in commit messages for an easy way to identify the purpose or intention of a commit. Check out the emoji cheatsheet here: CONTRIBUTING.md