Since "outbox" is the default, when someone accesses "/" (the root of the relay address, example https://haven.girino.org/) it tries to create a second "outbox" and panics because the address "/static" is already registered to the mux.
haven-relay | 2024/09/26 23:28:50 http: panic serving 192.168.41.101:45162: pattern "GET /static/" (registered at /app/main.go:257) conflicts with pattern "GET /static/" (registered at /app/main.go:257):
haven-relay | GET /static/ matches the same requests as GET /static/
haven-relay | goroutine 127 [running]:
haven-relay | net/http.(*conn).serve.func1()
haven-relay | /usr/local/go/src/net/http/server.go:1947 +0xbe
haven-relay | panic({0xd04ca0?, 0xc000116430?})
to temporarily solve it I added a boolean to check if outbox is already initialized. If so, return the already initialized object.
Since "outbox" is the default, when someone accesses "/" (the root of the relay address, example https://haven.girino.org/) it tries to create a second "outbox" and panics because the address "/static" is already registered to the mux.
to temporarily solve it I added a boolean to check if outbox is already initialized. If so, return the already initialized object.