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 *.exe
*.md *.md
.env .env
.env.example .env.*
!.env.example
.git .git
.gitignore .gitignore
tts_api_architecture.html tts_api_architecture.html
+7 -2
View File
@@ -1,4 +1,4 @@
# Go build cache # Go build cache
.gocache/ .gocache/
*.exe *.exe
*.test *.test
@@ -11,4 +11,9 @@
Thumbs.db Thumbs.db
# Logs # Logs
*.log *.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) duration := time.Since(started)
finalData := parsed.AudioData finalData := parsed.AudioData
// finalFormat 反映真实输出格式(用于 controller 写 Content-Type):
// - wav 走 pcm 上游 + 本地拼头,对外仍是 wav
// - aac/flac 在上方已被上游降级为 mp3,真实输出也是 mp3
// - 其余与 clientFormat 一致
finalFormat := clientFormat finalFormat := clientFormat
if clientFormat != "wav" {
finalFormat = opts.Format
}
sampleRate := opts.SampleRate sampleRate := opts.SampleRate
if clientFormat == "wav" { if clientFormat == "wav" {
wav, wrapErr := WrapWAVHeader(parsed.AudioData, opts.SampleRate) wav, wrapErr := WrapWAVHeader(parsed.AudioData, opts.SampleRate)