MCPcopy Create free account
hub / github.com/goadesign/goa / bodyAllowedForStatus

Function bodyAllowedForStatus

expr/http_response.go:397–407  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

395// permits a body. See RFC 2616, section 4.4.
396// See https://golang.org/src/net/http/transfer.go
397func 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}

Callers 1

ValidateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected