From 43168af954f512b2a6ee4488a6483f340636aa1a Mon Sep 17 00:00:00 2001 From: Xu Han Date: Mon, 20 Nov 2023 14:25:47 +0800 Subject: [PATCH] allow track request in readonly mode --- app/action/start.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/action/start.go b/app/action/start.go index 81b2d0c..29518a5 100644 --- a/app/action/start.go +++ b/app/action/start.go @@ -159,6 +159,15 @@ func readonlyMiddleware() echo.MiddlewareFunc { // fine return next(c) } + + // certain POST requests should also be allowed + if method == "POST" { + path := c.Request().URL.Path + if path == "/api/stream/track" { + return next(c) + } + } + return echo.NewHTTPError(http.StatusMethodNotAllowed) } }