-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit 2fb8419
Fix DefaultBinder empty body handling for unknown ContentLength
Fix issue where POST requests with empty bodies and ContentLength=-1
(unknown/chunked encoding) incorrectly fail with 415 Unsupported Media Type.
The DefaultBinder.BindBody method now properly detects truly empty bodies
when ContentLength=-1 by peeking at the first byte. If no content is found,
it returns early without error. If content exists, it reconstructs the body
to preserve the original data.
Fixes #2813
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 61da50f commit 2fb8419
2 files changed
+25
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | + | ||
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
75 | + | ||
76 | + | ||
77 | + | ||
78 | + | ||
79 | + | ||
80 | + | ||
81 | + | ||
82 | + | ||
83 | + | ||
84 | + | ||
85 | + | ||
86 | + | ||
87 | + | ||
88 | + | ||
89 | + | ||
90 | + | ||
74 | 91 | | |
75 | 92 | | |
76 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1082 | 1082 | | |
1083 | 1083 | | |
1084 | 1084 | | |
1085 | + | ||
1086 | + | ||
1087 | + | ||
1088 | + | ||
1089 | + | ||
1090 | + | ||
1091 | + | ||
1092 | + | ||
1085 | 1093 | | |
1086 | 1094 | | |
1087 | 1095 | | |
| |||
0 commit comments