fix: 安全加固(VUL-001~009)+ 构建版本注入 + 死代码清理 #2

Merged
sun merged 12 commits from develop into main 2026-08-27 11:01:48 +08:00
3 changed files with 16 additions and 3 deletions
Showing only changes of commit 72d0d6a3a9 - Show all commits
+2 -1
View File
@@ -1,7 +1,8 @@
*.exe
*.md
.env
.env.example
.env.*
!.env.example
.git
.gitignore
tts_api_architecture.html
+6 -1
View File
@@ -1,4 +1,4 @@
# Go build cache
# Go build cache
.gocache/
*.exe
*.test
@@ -12,3 +12,8 @@ Thumbs.db
# Logs
*.log
# Secrets (do NOT commit local .env files; keep .env.example tracked as template)
.env
.env.*
!.env.example
+7
View File
@@ -116,7 +116,14 @@ func Synthesis(
duration := time.Since(started)
finalData := parsed.AudioData
// finalFormat 反映真实输出格式(用于 controller 写 Content-Type):
// - wav 走 pcm 上游 + 本地拼头,对外仍是 wav
// - aac/flac 在上方已被上游降级为 mp3,真实输出也是 mp3
// - 其余与 clientFormat 一致
finalFormat := clientFormat
if clientFormat != "wav" {
finalFormat = opts.Format
}
sampleRate := opts.SampleRate
if clientFormat == "wav" {
wav, wrapErr := WrapWAVHeader(parsed.AudioData, opts.SampleRate)