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(transport/http): responseEncoder should not write any data when it need to write nil #1945

Merged
merged 3 commits into from Apr 27, 2022

Conversation

Donglong
Copy link
Contributor

@Donglong Donglong commented Apr 24, 2022

Description (what this PR does / why we need it):

It should not write any data when we don't need to return data to the client

Which issue(s) this PR fixes (resolves / be part of):

fixes #1946

Other special notes for reviewer:

@shenqidebaozi
Copy link
Sponsor Member

You should submit an issue and explain in the issue what problems you have encountered and why you want to solve them in this way, and then associate the PR with it to facilitate other users to understand what the PR has done

@Donglong
Copy link
Contributor Author

@shenqidebaozi I done, is OK?

transport/http/codec.go Outdated Show resolved Hide resolved
@tonybase tonybase merged commit 60465cc into go-kratos:main Apr 27, 2022
tonybase pushed a commit that referenced this pull request May 31, 2022
…t need to write nil (#1945)

* fix(transport/http): responseEncoder should not write any data when it need to write nil

* test(transport/http): adjust the test of response encoder encode nil value

* fix(transport/http): remove content-type setting
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.

ResponseEncode should not write any data when it encode nil
3 participants