Support x-www-form-urlencoded form-data
This commit is contained in:
parent
860e540de1
commit
c46190c3fc
@ -15,6 +15,7 @@
|
||||
- app-store link in HTML
|
||||
|
||||
- deploy
|
||||
- deploy apache conf directly
|
||||
|
||||
- backups (no longer container in my db_backup, perhaps extend it to sqlite?)
|
||||
|
||||
|
@ -263,6 +263,10 @@ func (app *Application) StartRequest(g *gin.Context, uri any, query any, body an
|
||||
if err := g.ShouldBindWith(form, binding.Form); err != nil {
|
||||
return nil, langext.Ptr(ginresp.APIError(g, 400, apierr.BINDFAIL_BODY_PARAM, "Failed to read multipart-form", err))
|
||||
}
|
||||
} else if g.ContentType() == "application/x-www-form-urlencoded" {
|
||||
if err := g.ShouldBindWith(form, binding.Form); err != nil {
|
||||
return nil, langext.Ptr(ginresp.APIError(g, 400, apierr.BINDFAIL_BODY_PARAM, "Failed to read urlencoded-form", err))
|
||||
}
|
||||
} else {
|
||||
if !ignoreWrongContentType {
|
||||
return nil, langext.Ptr(ginresp.APIError(g, 400, apierr.BINDFAIL_BODY_PARAM, "missing form body", nil))
|
||||
|
Loading…
Reference in New Issue
Block a user