Skip to content

Commit 2d0f5e3

Browse files
committed
binding: allow PATCH in bind
Addresses gogs/go-gogs-client#111.
1 parent 0a927dc commit 2d0f5e3

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" {
44+
if ctx.Req.Method == "POST" || ctx.Req.Method == "PUT" || ctx.Req.Method == "PATCH" {
4545
switch {
4646
case strings.Contains(contentType, "form-urlencoded"):
4747
ctx.Invoke(Form(obj, ifacePtr...))

0 commit comments

Comments
 (0)