Skip to content

Commit

Permalink
resolve #19 (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
kesuskim authored Sep 25, 2021
1 parent 3ac0dd7 commit aaf4249
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion swagger.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"sync"

"github.com/labstack/echo/v4"
"github.com/swaggo/files"
swaggerFiles "github.com/swaggo/files"
"github.com/swaggo/swag"
)

Expand Down Expand Up @@ -84,6 +84,8 @@ func EchoWrapHandler(configFns ...func(c *Config)) echo.HandlerFunc {
handler.Prefix = matches[1]
})

defer c.Response().Flush()

switch path {
case "index.html":
_ = index.Execute(c.Response().Writer, config)
Expand Down

4 comments on commit aaf4249

@ntferr
Copy link

@ntferr ntferr commented on aaf4249 Oct 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a problem with this flush when I went up with the lambda. lib i'm using github.com/awslabs/aws-lambda-go-api-proxy/echo

@ubogdan
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add more context so we can reproduce it?

@ntferr
Copy link

@ntferr ntferr commented on aaf4249 Oct 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error occurs at the time after you start the lambda and try to hit the swagger endpoint.

That's the mistake I picked up:

[PANIC RECOVER] interface conversion: *core.ProxyResponseWriter is not http.Flusher: missing method Flush goroutine 54 [running]:
github.com/labstack/echo/v4/middleware.RecoverWithConfig.func1.1.1(0xef5fc8, 0x1000, 0x0, 0x1077148, 0xc001bcaa00)

@ubogdan
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. This sounds like a valid bug. Please open an issue with the link to this commit and the panic so we can work on a fix.

Please sign in to comment.