mirror of
https://github.com/gesellix/Bose-SoundTouch.git
synced 2026-08-19 09:06:14 +00:00
refactor(web): proxy TTS through /api/setup/tts/speak (refs #451)
Point soundtouch-web's TTS proxy at the new canonical /api/setup/tts/speak path (request URL and doc comment). No behavior change; the legacy path still works. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
dbdc75627a
commit
3d5add3a07
@@ -38,7 +38,7 @@ func hostOnly(raw string) string {
|
||||
// HandleAPISpeakText synthesizes and plays text on a device. The Web UI talks
|
||||
// to speakers directly for most controls, but TTS synthesis (Google Cloud) and
|
||||
// the Bose app_key live in the AfterTouch service, so this proxies to the
|
||||
// service's /setup/tts/speak endpoint, targeting the device by its IP/host.
|
||||
// service's /api/setup/tts/speak endpoint, targeting the device by its IP/host.
|
||||
func (app *WebApp) HandleAPISpeakText(w http.ResponseWriter, r *http.Request) {
|
||||
deviceID := chi.URLParam(r, "id")
|
||||
|
||||
@@ -118,7 +118,7 @@ func (app *WebApp) HandleAPISpeakText(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
upstream, err := http.NewRequestWithContext(r.Context(), http.MethodPost, serviceURL+"/setup/tts/speak", bytes.NewReader(body))
|
||||
upstream, err := http.NewRequestWithContext(r.Context(), http.MethodPost, serviceURL+"/api/setup/tts/speak", bytes.NewReader(body))
|
||||
if err != nil {
|
||||
app.sendError(w, "Failed to build TTS request", http.StatusInternalServerError)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user