From d276f64915dbba428271404ddd2a8c2d154b7d59 Mon Sep 17 00:00:00 2001 From: ttyS3 Date: Wed, 9 Aug 2023 00:49:04 +0800 Subject: [PATCH] fix(echo): avoid duplicated body response --- echo/echo.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/echo/echo.go b/echo/echo.go index 1733372..fa9e790 100644 --- a/echo/echo.go +++ b/echo/echo.go @@ -11,6 +11,9 @@ func New(doc redoc.Redoc) echo.MiddlewareFunc { return func(next echo.HandlerFunc) echo.HandlerFunc { return func(ctx echo.Context) error { handle(ctx.Response(), ctx.Request()) + if ctx.Response().Committed { + return nil + } return next(ctx) } }