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: #2938 #3178

Merged
merged 3 commits into from
Dec 20, 2023
Merged

fix: #2938 #3178

merged 3 commits into from
Dec 20, 2023

Conversation

hailaz
Copy link
Member

@hailaz hailaz commented Nov 27, 2023

fix #2938
如果需要body支持复读,可以在前置中间件中使用r.MakeBodyRepeatableRead(true)

s.Group("/", func(group *ghttp.RouterGroup) {
		group.Middleware(func(r *ghttp.Request) {
			fmt.Println("middleware")
			r.MakeBodyRepeatableRead(true)
			r.Middleware.Next()
		})
		group.Middleware(ghttp.MiddlewareHandlerResponse)
		group.Bind(cUpload{})
	})

example/httpserver/upload_file/main.go Outdated Show resolved Hide resolved
net/ghttp/ghttp_z_unit_feature_config_test.go Show resolved Hide resolved
@hailaz hailaz requested a review from gqcn December 6, 2023 08:38
@gqcn gqcn added the ready to merge Used in PR, which means this PR is reviewed. label Dec 6, 2023
@gqcn gqcn merged commit 7f9467d into master Dec 20, 2023
42 checks passed
@gqcn gqcn deleted the fix/#2938 branch December 20, 2023 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Used in PR, which means this PR is reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] When uploading normative routing files, the memory overhead is too large
2 participants