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(net/gclient): using the wrong header to update file #3775

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

oldme-git
Copy link
Member

fixed #3748

Copy link

sonarcloud bot commented Sep 13, 2024

httpHeaderContentTypeXml,
httpHeaderContentTypeForm}
return !gstr.InArray(notAllows, c.header[httpHeaderContentType])
}
Copy link
Member

Choose a reason for hiding this comment

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

等等,我看了下这个issue #3748 只是提了会报panic,应该是参数处理不严谨。而你这个pr做了一些枚举来允许文件上传,好像是两码事了诶?!

Copy link
Member Author

Choose a reason for hiding this comment

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

之前这块的上传逻辑不严谨,如果 header content-type 头是 json 或者 xml 这种不允许上传文件的头,应该将其做为一个普通的字符串上传

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gf/net/gclient/gclient_request.go: panic while post data "@file:"
3 participants