Closed m1k1o closed 1 year ago
Panic happens when using custom policy with extensions without install url: <id> instead of <id>;<url>
<id>
<id>;<url>
"runtime error: index out of range [1] with length 1","stack":"goroutine 3016 [running]: runtime/debug.Stack() /usr/local/go/src/runtime/debug/stack.go:24 +0x65 github.com/go-chi/chi/middleware.Recoverer.func1.1() /go/pkg/mod/github.com/go-chi/chi@v4.1.2+incompatible/middleware/recoverer.go:28 +0xa9 panic({0xa12740, 0xc000490a08}) /usr/local/go/src/runtime/panic.go:838 +0x207 github.com/m1k1o/neko-rooms/internal/policies/chromium.Parse({0xc000166800, 0x3f9}) /app/internal/policies/chromium/parser.go:32 +0x3bf github.com/m1k1o/neko-rooms/internal/policies.Parse({0xc000166800?, 0xc000166400?}, {0xc00038a3d0?, 0xc00005e120?}) /app/internal/policies/config.go:25 +0x3c github.com/m1k1o/neko-rooms/internal/room.(*RoomManagerCtx).GetSettings(0xc00034cd90, {0xc00020d907?, 0x6?}) /app/internal/room/manager.go:581 +0x3f7 github.com/m1k1o/neko-rooms/internal/api.(*ApiManagerCtx).roomGetSettings(0xc000346f00, {0x7f6030936140, 0xc000624140}, 0x8?) /app/internal/api/rooms.go:117 +0x71 net/http.HandlerFunc.ServeHTTP(0x9b2fe0?, {0x7f6030936140?, 0xc000624140?}, 0xc000316d60?) /usr/local/go/src/net/http/server.go:2084 +0x2f github.com/go-chi/chi.(*Mux).routeHTTP(0xc000062b40, {0x7f6030936140, 0xc000624140}, 0xc0004c1b00) /go/pkg/mod/github.com/go-chi/chi@v4.1.2+incompatible/mux.go:431 +0x1f9 net/http.HandlerFunc.ServeHTTP(0x0?, {0x7f6030936140?, 0xc000624140?}, 0x450b10?) /usr/local/go/src/net/http/server.go:2084 +0x2f github.com/go-chi/chi.(*Mux).ServeHTTP(0xc000062b40, {0x7f6030936140, 0xc000624140}, 0xc0004c1b00) /go/pkg/mod/github.com/go-chi/chi@v4.1.2+incompatible/mux.go:70 +0x40e github.com/go-chi/chi.(*Mux).Mount.func1({0x7f6030936140, 0xc000624140}, 0xc0004c1b00) /go/pkg/mod/github.com/go-chi/chi@v4.1.2+incompatible/mux.go:298 +0x13b net/http.HandlerFunc.ServeHTTP(0x9b2fe0?, {0x7f6030936140?, 0xc000624140?}, 0xc00020d900?) /usr/local/go/src/net/http/server.go:2084 +0x2f github.com/go-chi/chi.(*Mux).routeHTTP(0xc000062a80, {0x7f6030936140, 0xc000624140}, 0xc0004c1b00) /go/pkg/mod/github.com/go-chi/chi@v4.1.2+incompatible/mux.go:431 +0x1f9 net/http.HandlerFunc.ServeHTTP(0x7f6057827a68?, {0x7f6030936140?, 0xc000624140?}, 0x450b10?) /usr/local/go/src/net/http/server.go:2084 +0x2f github.com/go-chi/chi.(*Mux).ServeHTTP(0xc000062a80, {0x7f6030936140, 0xc000624140}, 0xc0004c1b00) /go/pkg/mod/github.com/go-chi/chi@v4.1.2+incompatible/mux.go:70 +0x40e github.com/go-chi/chi.(*Mux).Mount.func1({0x7f6030936140, 0xc000624140}, 0xc0004c1b00) /go/pkg/mod/github.com/go-chi/chi@v4.1.2+incompatible/mux.go:298 +0x13b net/http.HandlerFunc.ServeHTTP(0x7f60309fa110?, {0x7f6030936140?, 0xc000624140?}, 0xf?) /usr/local/go/src/net/http/server.go:2084 +0x2f github.com/m1k1o/neko-rooms/internal/server.New.func1.1({0x7f6030936140, 0xc000624140}, 0xc0004c1b00) /app/internal/server/manager.go:154 +0xa27 net/http.HandlerFunc.ServeHTTP(0xc0003a2660?, {0x7f6030936140?, 0xc000624140?}, 0xc0001f8138?) /usr/local/go/src/net/http/server.go:2084 +0x2f github.com/go-chi/chi.(*ChainHandler).ServeHTTP(0x9b2fe0?, {0x7f6030936140?, 0xc000624140?}, 0xc0000cd494?) /go/pkg/mod/github.com/go-chi/chi@v4.1.2+incompatible/chain.go:31 +0x2c github.com/go-chi/chi.(*Mux).routeHTTP(0xc000062840, {0x7f6030936140, 0xc000624140}, 0xc0004c1b00) /go/pkg/mod/github.com/go-chi/chi@v4.1.2+incompatible/mux.go:431 +0x1f9 net/http.HandlerFunc.ServeHTTP(0x9b3940?, {0x7f6030936140?, 0xc000624140?}, 0x5c?) /usr/local/go/src/net/http/server.go:2084 +0x2f github.com/m1k1o/neko-rooms/internal/server.New.func3.1({0x7f6030936140, 0xc000624140}, 0xc0004c1b00) /app/internal/server/manager.go:207 +0x174 net/http.HandlerFunc.ServeHTTP(0xc0003626e0?, {0x7f6030936140?, 0xc000624140?}, 0xc0004c1b00?) /usr/local/go/src/net/http/server.go:2084 +0x2f github.com/go-chi/cors.(*Cors).Handler.func1({0x7f6030936140, 0xc000624140}, 0xc0004c1b00) /go/pkg/mod/github.com/go-chi/cors@v1.2.1/cors.go:228 +0x1bd net/http.HandlerFunc.ServeHTTP(0xa25760?, {0x7f6030936140?, 0xc000624140?}, 0x93070f?) /usr/local/go/src/net/http/server.go:2084 +0x2f github.com/go-chi/chi/middleware.Recoverer.func1({0x7f6030936140?, 0xc000624140?}, 0xc0004fcd00?) /go/pkg/mod/github.com/go-chi/chi@v4.1.2+incompatible/middleware/recoverer.go:37 +0x83 net/http.HandlerFunc.ServeHTTP(0xc0004c1a00?, {0x7f6030936140?, 0xc000624140?}, 0x0?) /usr/local/go/src/net/http/server.go:2084 +0x2f github.com/go-chi/chi/middleware.RequestLogger.func1.1({0xb3db78, 0xc00031b500}, 0xc0004c1a00) /go/pkg/mod/github.com/go-chi/chi@v4.1.2+incompatible/middleware/logger.go:46 +0x43b net/http.HandlerFunc.ServeHTTP(0xb3e160?, {0xb3db78?, 0xc00031b500?}, 0xb378b0?) /usr/local/go/src/net/http/server.go:2084 +0x2f github.com/go-chi/chi/middleware.RequestID.func1({0xb3db78, 0xc00031b500}, 0xc0004c1900) /go/pkg/mod/github.com/go-chi/chi@v4.1.2+incompatible/middleware/request_id.go:76 +0x354 net/http.HandlerFunc.ServeHTTP(0xb3e0b8?, {0xb3db78?, 0xc00031b500?}, 0xe789b0?) /usr/local/go/src/net/http/server.go:2084 +0x2f github.com/go-chi/chi.(*Mux).ServeHTTP(0xc000062840, {0xb3db78, 0xc00031b500}, 0xc000465800) /go/pkg/mod/github.com/go-chi/chi@v4.1.2+incompatible/mux.go:86 +0x3c2 net/http.serverHandler.ServeHTTP({0xc0003a26f0?}, {0xb3db78, 0xc00031b500}, 0xc000465800) /usr/local/go/src/net/http/server.go:2916 +0x43b net/http.(*conn).serve(0xc0002f8000, {0xb3e160, 0xc000414150}) /usr/local/go/src/net/http/server.go:1966 +0x5d7 created by net/http.(*Server).Serve /usr/local/go/src/net/http/server.go:3071 +0x4db
Panic happens when using custom policy with extensions without install url:
<id>
instead of<id>;<url>