Skip to content

Commit ad05986

Browse files
committed
chore: stop using default mux in SDK server
This is essentially a hack. We need to be able to run the SDK server twice in Obot to fix some short-term dependency cycles. We are unable to do this if both use the default server mux. This change will use a separate mux for each. Signed-off-by: Donnie Adams <[email protected]>
1 parent f962ce4 commit ad05986

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/sdkserver/server.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,11 @@ func run(ctx context.Context, listener net.Listener, opts Options) error {
126126
}
127127
defer s.close()
128128

129-
s.addRoutes(http.DefaultServeMux)
129+
mux := http.NewServeMux()
130+
s.addRoutes(mux)
130131

131132
httpServer := &http.Server{
132-
Handler: apply(http.DefaultServeMux,
133+
Handler: apply(mux,
133134
contentType("application/json"),
134135
addRequestID,
135136
addLogger,

0 commit comments

Comments
 (0)