Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/go-playground/validator/v10 v10.11.0
github.com/google/uuid v1.3.0
github.com/juju/errors v0.0.0-20220622220526-54a94488269b
github.com/mattn/go-sqlite3 v2.0.3+incompatible
github.com/mattn/go-sqlite3 v1.14.16
github.com/pires/go-proxyproto v0.6.2
)

Expand Down
8 changes: 4 additions & 4 deletions tonic/tonic.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ func DefaultBindingHookMaxBodyBytes(maxBodyBytes int64) BindHook {
return nil
}

ct := c.Request.Header["Content-Type"]
ct := c.ContentType()
var b binding.Binding = binding.JSON

if len(ct) == 1 && ct[0] == binding.MIMEPOSTForm {
if ct == binding.MIMEPOSTForm {
b = binding.Form
} else if len(ct) == 1 && ct[0] == binding.MIMEMultipartPOSTForm {
} else if ct == binding.MIMEMultipartPOSTForm {
b = binding.FormMultipart
} else if len(ct) == 1 && ct[0] == binding.MIMEXML {
} else if ct == binding.MIMEXML {
b = binding.XML
}

Expand Down