diff --git a/adapter/volcano/volcano.go b/adapter/volcano/volcano.go index 3453b76..603ff7c 100644 --- a/adapter/volcano/volcano.go +++ b/adapter/volcano/volcano.go @@ -132,6 +132,8 @@ func Synthesis(config *dto.ByteDanceTTSConfig, httpClient *HTTPClient, text stri if v3Resp.Usage != nil { log.Printf("TTS synthesis completed, usage: %+v", v3Resp.Usage) } + for scanner.Scan() { + } break } diff --git a/common/constants.go b/common/constants.go index 853ca08..ea7a6d9 100644 --- a/common/constants.go +++ b/common/constants.go @@ -1,4 +1,4 @@ -package common +package common import "time" diff --git a/controller/tts.go b/controller/tts.go index 7a40da9..03c6297 100644 --- a/controller/tts.go +++ b/controller/tts.go @@ -58,11 +58,10 @@ func OpenaiTTSHandler(w http.ResponseWriter, r *http.Request) { r.Body = http.MaxBytesReader(w, r.Body, common.MaxRequestBodySize) body, err := io.ReadAll(r.Body) if err != nil { - if strings.Contains(err.Error(), "request body too large") { - http.Error(w, fmt.Sprintf("Request body too large (max %d bytes)", common.MaxRequestBodySize), http.StatusRequestEntityTooLarge) - return - } - http.Error(w, "Failed to read request body", http.StatusBadRequest) + if strings.Contains(err.Error(), "request body too large") { + return + } + http.Error(w, "Failed to read request body", http.StatusBadRequest) return }