Skip to content

return empty ReadCloser for nil request body#170

Merged
syumai merged 1 commit intomainfrom
return-empty-read-closer-for-nil-request-body
Apr 13, 2025
Merged

return empty ReadCloser for nil request body#170
syumai merged 1 commit intomainfrom
return-empty-read-closer-for-nil-request-body

Conversation

@syumai
Copy link
Owner

@syumai syumai commented Apr 13, 2025

What

  • Changed code to return an empty ReadCloser when request body is nil.

Motivation

  • Without this change, if a handler attempts to access Request.Body when it's nil, the application would panic. This fix prevents the crash and provides a proper empty reader instead.

@syumai syumai self-assigned this Apr 13, 2025
@syumai syumai merged commit e7a52ef into main Apr 13, 2025
2 checks passed
@syumai syumai deleted the return-empty-read-closer-for-nil-request-body branch April 13, 2025 11:06
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.

1 participant