Skip to content

Commit 43d646d

Browse files
committed
Updated echo version to v5
1 parent 4649b35 commit 43d646d

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

server/router/api/v1/sse_handler.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"net/http"
77
"time"
88

9-
"github.com/labstack/echo/v4"
9+
"github.com/labstack/echo/v5"
1010

1111
"github.com/usememos/memos/server/auth"
1212
"github.com/usememos/memos/store"
@@ -20,15 +20,15 @@ const (
2020
// RegisterSSERoutes registers the SSE endpoint on the given Echo instance.
2121
func RegisterSSERoutes(echoServer *echo.Echo, hub *SSEHub, storeInstance *store.Store, secret string) {
2222
authenticator := auth.NewAuthenticator(storeInstance, secret)
23-
echoServer.GET("/api/v1/sse", func(c echo.Context) error {
23+
echoServer.GET("/api/v1/sse", func(c *echo.Context) error {
2424
return handleSSE(c, hub, authenticator)
2525
})
2626
}
2727

2828
// handleSSE handles the SSE connection for live memo refresh.
2929
// Authentication is done via Bearer token in the Authorization header,
3030
// or via the "token" query parameter (for EventSource which cannot set headers).
31-
func handleSSE(c echo.Context, hub *SSEHub, authenticator *auth.Authenticator) error {
31+
func handleSSE(c *echo.Context, hub *SSEHub, authenticator *auth.Authenticator) error {
3232
// Authenticate the request.
3333
authHeader := c.Request().Header.Get("Authorization")
3434
if authHeader == "" {
@@ -52,7 +52,7 @@ func handleSSE(c echo.Context, hub *SSEHub, authenticator *auth.Authenticator) e
5252
w.WriteHeader(http.StatusOK)
5353

5454
// Flush headers immediately.
55-
if f, ok := w.Writer.(http.Flusher); ok {
55+
if f, ok := w.(http.Flusher); ok {
5656
f.Flush()
5757
}
5858

@@ -84,7 +84,7 @@ func handleSSE(c echo.Context, hub *SSEHub, authenticator *auth.Authenticator) e
8484
if _, err := fmt.Fprintf(w, "data: %s\n\n", data); err != nil {
8585
return nil
8686
}
87-
if f, ok := w.Writer.(http.Flusher); ok {
87+
if f, ok := w.(http.Flusher); ok {
8888
f.Flush()
8989
}
9090

@@ -93,7 +93,7 @@ func handleSSE(c echo.Context, hub *SSEHub, authenticator *auth.Authenticator) e
9393
if _, err := fmt.Fprint(w, ": heartbeat\n\n"); err != nil {
9494
return nil
9595
}
96-
if f, ok := w.Writer.(http.Flusher); ok {
96+
if f, ok := w.(http.Flusher); ok {
9797
f.Flush()
9898
}
9999
}

server/router/fileserver/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ Parses data URI to extract MIME type and base64 data.
184184
## Dependencies
185185

186186
### External Packages
187-
- `github.com/labstack/echo/v4` - HTTP router and middleware
187+
- `github.com/labstack/echo/v5` - HTTP router and middleware
188188
- `github.com/golang-jwt/jwt/v5` - JWT parsing and validation
189189
- `github.com/disintegration/imaging` - Image thumbnail generation
190190
- `golang.org/x/sync/semaphore` - Concurrency control for thumbnails

0 commit comments

Comments
 (0)