Commit 1cc0135
committed
fix: populate
When sending POST requests with a non-empty body
that trigger 307/308 redirects, the redirects fail
because the underlying `http.Request.GetBody` is
nil by default.
This patch populates `GetBody` using the existing
reusable body reader, allowing the `net/http`
client to rewind and replay the body.
Fixes #493.
Signed-off-by: Dwi Siswanto <[email protected]>GetBody to support 307/308 redirects1 parent e49953b commit 1cc0135
1 file changed
+7
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
197 | 198 | | |
198 | 199 | | |
199 | 200 | | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
200 | 204 | | |
201 | 205 | | |
202 | 206 | | |
| |||
259 | 263 | | |
260 | 264 | | |
261 | 265 | | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
262 | 269 | | |
263 | 270 | | |
264 | 271 | | |
| |||
0 commit comments