Skip to content
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

fix re-enter middleware bug #3641

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Robert-XIAO-777
Copy link

When we use HandleContext re-enter,middleware handlers will be covered
image

@rstrlcpy
Copy link

rstrlcpy commented Feb 1, 2024

I can confirm the issue.
PATH_A is a path where HandleContext to redirect to PATH_B. If PATH_B has more handlers than PATH_A then part of PATH_B handlers will be executed one more time after processing of PATH_A has been done.

@appleboy appleboy added the bug label Feb 1, 2024
@appleboy appleboy added this to the v1.10 milestone Feb 1, 2024
@appleboy
Copy link
Member

appleboy commented Feb 5, 2024

@Robert-XIAO-777 Please rebase the latest master branch. Thanks.

c.reset()
engine.handleHTTPRequest(c)

c.index = oldIndexValue
c.handlers = oldHandles
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please help to add the unit testing case.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@appleboy fix with test can be found here #3987

@appleboy appleboy modified the milestones: v1.10, v1.11 Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants