Skip to content

Harden TTS engine HTTP clients#6

Open
phyceClaw wants to merge 1 commit into
phyce:mainfrom
phyceClaw:fix/engine-http-hardening
Open

Harden TTS engine HTTP clients#6
phyceClaw wants to merge 1 commit into
phyce:mainfrom
phyceClaw:fix/engine-http-hardening

Conversation

@phyceClaw

Copy link
Copy Markdown

Summary

  • Timeouts: ElevenLabs and OpenAI used &http.Client{} with no timeout; a hung endpoint blocked the pooled instance indefinitely. Added request timeouts (matching Gemini).
  • Gemini key in URL: the API key was passed as ?key=..., leaking into logs/proxies/error bodies. Now sent via the x-goog-api-key header.
  • Google client reuse: a new texttospeech.Client was created on every request; now created once and reused.

Testing

CGO_ENABLED=1 go build ./app/... passes; go vet clean.

🤖 Generated with Claude Code

- Add request timeouts to ElevenLabs and OpenAI HTTP clients (a hung
  endpoint no longer blocks a pooled instance forever)
- Send the Gemini API key via the x-goog-api-key header instead of a
  URL query param (avoids leaking the key into logs/proxies/errors)
- Reuse a single Google TextToSpeech client instead of creating one
  per request

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant