mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-30 23:44:59 +00:00
debug
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
parent
dcb13a7e6f
commit
4ca7689f31
3 changed files with 34 additions and 22 deletions
|
@ -182,16 +182,26 @@ func API(application *application.Application) (*fiber.App, error) {
|
|||
Browse: true,
|
||||
}))
|
||||
|
||||
app.Use("/ws", func(c *fiber.Ctx) error {
|
||||
// IsWebSocketUpgrade returns true if the client
|
||||
// requested upgrade to the WebSocket protocol.
|
||||
app.Use(func(c *fiber.Ctx) error {
|
||||
if websocket.IsWebSocketUpgrade(c) {
|
||||
c.Locals("allowed", true)
|
||||
return c.Next()
|
||||
// Returns true if the client requested upgrade to the WebSocket protocol
|
||||
c.Next()
|
||||
}
|
||||
return fiber.ErrUpgradeRequired
|
||||
|
||||
return nil
|
||||
})
|
||||
|
||||
// app.Use("/v1/realtime", func(c *fiber.Ctx) error {
|
||||
// fmt.Println("Hit upgrade from http")
|
||||
// // IsWebSocketUpgrade returns true if the client
|
||||
// // requested upgrade to the WebSocket protocol.
|
||||
// if websocket.IsWebSocketUpgrade(c) {
|
||||
// c.Locals("allowed", true)
|
||||
// return c.Next()
|
||||
// }
|
||||
// return fiber.ErrUpgradeRequired
|
||||
// })
|
||||
|
||||
// Define a custom 404 handler
|
||||
// Note: keep this at the bottom!
|
||||
router.Use(notFoundHandler)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue