From be6c2ad34e3d94cf046acaf4604ae9cd0325afa3 Mon Sep 17 00:00:00 2001 From: sun <3371392206@qq.com> Date: Tue, 26 May 2026 10:42:41 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"fix:=20=E4=BF=AE=E5=A4=8D=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E4=BD=93=E8=BF=87=E5=A4=A7=E5=A4=84=E7=90=86=E5=92=8C?= =?UTF-8?q?=E5=86=97=E4=BD=99=E4=BB=A3=E7=A0=81=E9=97=AE=E9=A2=98"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 23b962a90e3c36265939d7833e63254d7d542801. --- adapter/volcano/volcano.go | 2 ++ common/constants.go | 2 +- controller/tts.go | 9 ++++----- 3 files changed, 7 insertions(+), 6 deletions(-) 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 }