Repository navigation
Conversation
This branch has not been deployed
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.
问题与修正
“Using middleware” 页面错误地说明:未调用
c.Next()会跳过后续中间件和 handler。实际行为是,只要上下文未被中止,当前中间件返回后,Gin 仍会继续执行处理链。这会误导鉴权中间件的实现。本次同步修正全部 12 个语言版本的执行顺序说明:
c.Next()仍会执行后续处理链。c.Next()可用于在后续处理完成后执行收尾代码,并限定 LIFO 描述适用的情形。c.Abort()/AbortWithStatus*会跳过尚未执行的处理函数,但不会终止当前函数;需要时应配合return。Fixes #423
验证
git diff --check通过。npm ci --no-audit --no-fund和npm run build成功,生成 1226 个页面。c.Next(),后续中间件和 handler 仍执行,返回200 "ok"。