Handle trailing slashes in URL (#2988)
When a user includes a trailing slash in LIVEKIT_URL, it would produce double slashes in the path, i.e. `https://myhost.livekit.cloud//twirp/RoomService.ListRooms` Currently the server will send a 302 MOVED response, causing Twirp requests to fail. We now remove the double slash in front within the middleware.
This commit is contained in:
@@ -102,6 +102,7 @@ func NewLivekitServer(conf *config.Config,
|
||||
// allow preflight to be cached for a day
|
||||
MaxAge: 86400,
|
||||
}),
|
||||
negroni.HandlerFunc(RemoveDoubleSlashes),
|
||||
}
|
||||
if keyProvider != nil {
|
||||
middlewares = append(middlewares, NewAPIKeyAuthMiddleware(keyProvider))
|
||||
|
||||
Reference in New Issue
Block a user