Przeglądaj źródła

Merge pull request #1779 from feitianbubu/pr/fix-video-get-task

fix: get video task err when Content-Type=json
Seefs 5 miesięcy temu
rodzic
commit
4137120d69
1 zmienionych plików z 3 dodań i 0 usunięć
  1. 3 0
      middleware/distributor.go

+ 3 - 0
middleware/distributor.go

@@ -169,6 +169,9 @@ func getModelRequest(c *gin.Context) (*ModelRequest, bool, error) {
 		relayMode := relayconstant.RelayModeUnknown
 		if c.Request.Method == http.MethodPost {
 			err = common.UnmarshalBodyReusable(c, &modelRequest)
+			if err != nil {
+				return nil, false, errors.New("video无效的请求, " + err.Error())
+			}
 			relayMode = relayconstant.RelayModeVideoSubmit
 		} else if c.Request.Method == http.MethodGet {
 			relayMode = relayconstant.RelayModeVideoFetchByID