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

new version v2.6.1 is not compatible with version v2.5.6 #3237

Closed
JB-fy opened this issue Jan 3, 2024 · 2 comments
Closed

new version v2.6.1 is not compatible with version v2.5.6 #3237

JB-fy opened this issue Jan 3, 2024 · 2 comments
Assignees
Labels
bug It is confirmed a bug, but don't worry, we'll handle it. done This issue is done, which may be release in next version.

Comments

@JB-fy
Copy link

JB-fy commented Jan 3, 2024

What version of Go and system type/arch are you using?
go1.20.4 linux/amd64

What version of GoFrame are you using?
2.5.6升级2.6.1

Can this bug be re-produced with the latest release?
1、升级后POST表单请求(application/x-www-form-urlencoded 或 multipart/form-data)进入控制器后,r.GetBody(),r.GetBodyString()和r.Body都读取不到数据,只能增加中间件设置r.MakeBodyRepeatableRead(true)。这与2.5.6版本不兼容,请问后续会做兼容,还是特意改动。

2、gconv.Map()与MapDeep()方法也与前版本不兼容。特别是Map()方法参数已经改动,MapDeep()方法理应也做改动,可却并未看到。升级后filter := gconv.MapDeep(req.Filter)现在得写成这样filter := gconv.Map(req.Filter, gconv.MapOption{Deep: true, OmitEmpty: true}),且gconv.Map()在2.5.6之前默认OmitEmpty=true,现在却是false。

@JB-fy JB-fy added the bug It is confirmed a bug, but don't worry, we'll handle it. label Jan 3, 2024
@Issues-translate-bot Issues-translate-bot changed the title 2.5.6升级2.6.1不兼容 2.5.6 is not compatible with upgrade 2.6.1 Jan 3, 2024
@gqcn gqcn self-assigned this Jan 15, 2024
@gqcn gqcn added the wip label Jan 15, 2024
@gqcn gqcn changed the title 2.5.6 is not compatible with upgrade 2.6.1 2.6.1 is not compatible with 2.5.6 Jan 15, 2024
@gqcn gqcn changed the title 2.6.1 is not compatible with 2.5.6 new version v2.6.1 is not compatible with version v2.5.6 Jan 15, 2024
gqcn added a commit that referenced this issue Jan 16, 2024
@gqcn
Copy link
Member

gqcn commented Jan 16, 2024

@JB-fy Fixed, but the OmitEmpty: true for map converting should be manually set if necessary in new version from v2.6.2.

@gqcn gqcn added done This issue is done, which may be release in next version. and removed wip labels Jan 16, 2024
@gqcn gqcn closed this as completed Jan 16, 2024
gqcn added a commit that referenced this issue Jan 17, 2024
@l12ab
Copy link

l12ab commented Feb 9, 2024

关于GetBodyString()的bug仍然有,测试版本2.6.3

1、当raw当时POST时,GetBodyString()可以正常拿到raw body

2、当application/x-www-form-urlencoded提交请求时,在处理请求的controller(handler)内、后置中间件里,GetBodyString()都拿不到数据;但是,如果添加一个前置中间件,在前置中间件里,调用一次GetBodyString(),可以取到数据,并且此时controller和后置中间件也能取到数据了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It is confirmed a bug, but don't worry, we'll handle it. done This issue is done, which may be release in next version.
Projects
None yet
Development

No branches or pull requests

3 participants