From fefcc5b124ce6850aa566f394c1ec4aa2227008a Mon Sep 17 00:00:00 2001 From: acelinkio <31336038+acelinkio@users.noreply.github.com> Date: Sat, 10 Jan 2026 01:40:07 -0800 Subject: [PATCH] auth/transcoder: fix tripple responses on errors (#1261) --- auth/main.go | 6 ++++++ transcoder/main.go | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/auth/main.go b/auth/main.go index 856c53f0..a3b4b67f 100644 --- a/auth/main.go +++ b/auth/main.go @@ -31,6 +31,12 @@ import ( ) func ErrorHandler(err error, c echo.Context) { + // otelecho & RequestLoggerWithConfig middleware call c.Error + // otelecho docs: https://pkg.go.dev/go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho#WithOnError + if c.Response().Committed { + return + } + code := http.StatusInternalServerError var message string diff --git a/transcoder/main.go b/transcoder/main.go index 76bf82a1..a93ecfa5 100644 --- a/transcoder/main.go +++ b/transcoder/main.go @@ -27,6 +27,12 @@ import ( ) func ErrorHandler(err error, c echo.Context) { + // otelecho & RequestLoggerWithConfig middleware call c.Error + // otelecho docs: https://pkg.go.dev/go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho#WithOnError + if c.Response().Committed { + return + } + code := http.StatusInternalServerError var message string if he, ok := err.(*echo.HTTPError); ok {