Skip to content

Commit b46ef76

Browse files
Dieterbeunknwon
authored andcommitted
ignore content-type header for requests that have no body. (#30)
fix #29
1 parent 0b4f37b commit b46ef76

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

binding.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func Version() string {
4141

4242
func bind(ctx *macaron.Context, obj interface{}, ifacePtr ...interface{}) {
4343
contentType := ctx.Req.Header.Get("Content-Type")
44-
if ctx.Req.Method == "POST" || ctx.Req.Method == "PUT" || len(contentType) > 0 {
44+
if ctx.Req.Method == "POST" || ctx.Req.Method == "PUT" {
4545
switch {
4646
case strings.Contains(contentType, "form-urlencoded"):
4747
ctx.Invoke(Form(obj, ifacePtr...))

0 commit comments

Comments
 (0)