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 {
394394 if strings .HasSuffix (ctype , "json" ) {
395395 return c .app .config .JSONDecoder (c .Body (), out )
396396 }
397- if strings . HasPrefix ( ctype , MIMEApplicationForm ) {
397+ if ctype == MIMEApplicationForm {
398398 data := make (map [string ][]string )
399399 var err error
400400
@@ -415,7 +415,7 @@ func (c *Ctx) BodyParser(out interface{}) error {
415415
416416 return c .parseToStruct (bodyTag , out , data )
417417 }
418- if strings . HasPrefix ( ctype , MIMEMultipartForm ) {
418+ if ctype == MIMEMultipartForm {
419419 multipartForm , err := c .fasthttp .MultipartForm ()
420420 if err != nil {
421421 return err
@@ -431,7 +431,7 @@ func (c *Ctx) BodyParser(out interface{}) error {
431431
432432 return c .parseToStruct (bodyTag , out , data )
433433 }
434- if strings . HasPrefix ( ctype , MIMETextXML ) || strings . HasPrefix ( ctype , MIMEApplicationXML ) {
434+ if ctype == MIMETextXML || ctype == MIMEApplicationXML {
435435 if err := xml .Unmarshal (c .Body (), out ); err != nil {
436436 return fmt .Errorf ("failed to unmarshal: %w" , err )
437437 }
You can’t perform that action at this time.
0 commit comments