File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -394,7 +394,7 @@ func (c *Ctx) BodyParser(out interface{}) error {
394
394
if strings .HasSuffix (ctype , "json" ) {
395
395
return c .app .config .JSONDecoder (c .Body (), out )
396
396
}
397
- if strings . HasPrefix ( ctype , MIMEApplicationForm ) {
397
+ if ctype == MIMEApplicationForm {
398
398
data := make (map [string ][]string )
399
399
var err error
400
400
@@ -415,7 +415,7 @@ func (c *Ctx) BodyParser(out interface{}) error {
415
415
416
416
return c .parseToStruct (bodyTag , out , data )
417
417
}
418
- if strings . HasPrefix ( ctype , MIMEMultipartForm ) {
418
+ if ctype == MIMEMultipartForm {
419
419
multipartForm , err := c .fasthttp .MultipartForm ()
420
420
if err != nil {
421
421
return err
@@ -431,7 +431,7 @@ func (c *Ctx) BodyParser(out interface{}) error {
431
431
432
432
return c .parseToStruct (bodyTag , out , data )
433
433
}
434
- if strings . HasPrefix ( ctype , MIMETextXML ) || strings . HasPrefix ( ctype , MIMEApplicationXML ) {
434
+ if ctype == MIMETextXML || ctype == MIMEApplicationXML {
435
435
if err := xml .Unmarshal (c .Body (), out ); err != nil {
436
436
return fmt .Errorf ("failed to unmarshal: %w" , err )
437
437
}
You can’t perform that action at this time.
0 commit comments