bodyAllowedForStatus reports whether a given response status code permits a body. See RFC 2616, section 4.4. See https://golang.org/src/net/http/transfer.go
(status int)
| 395 | // permits a body. See RFC 2616, section 4.4. |
| 396 | // See https://golang.org/src/net/http/transfer.go |
| 397 | func bodyAllowedForStatus(status int) bool { |
| 398 | switch { |
| 399 | case status >= 100 && status <= 199: |
| 400 | return false |
| 401 | case status == 204: |
| 402 | return false |
| 403 | case status == 304: |
| 404 | return false |
| 405 | } |
| 406 | return true |
| 407 | } |