feat: 所有API返回的音频URL加OSS预签名(24小时有效期) #216
Reference in New Issue
Block a user
Delete Branch "fix/tts-audio-url-presign"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
问题
TTS 合成虽然通了,但 output_audio_url 返回的是 OSS 裸 URL,私有 bucket 下前端访问 403。
修复
跟视频生成的 download_url 一样,对所有 API 返回的音频 URL 统一加 OSS 预签名(slash_safe=True,24小时有效期)。
覆盖范围
实现
get_audio_url_signer()依赖,返回签名函数(空URL直接返回,签名失败回退原始URL)_to_response函数接受sign_url可选参数,对音频URL字段做签名OSSStorageService.get_download_url(),逻辑与视频下载URL完全一致测试