Skip to content

Commit 32d9143

Browse files
committed
fix: 404 Page Not Found After Latest Commit bc1d212 #21
1 parent bc1d212 commit 32d9143

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

http.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,13 @@ func startHTTPServer(config *Config) error {
120120
if len(clientConfig.Options.AuthTokens) > 0 {
121121
middlewares = append(middlewares, newAuthMiddleware(clientConfig.Options.AuthTokens))
122122
}
123-
mcpRoute := path.Join(baseURL.Path, name) + "/"
123+
mcpRoute := path.Join(baseURL.Path, name)
124+
if !strings.HasPrefix(mcpRoute, "/") {
125+
mcpRoute = "/" + mcpRoute
126+
}
127+
if !strings.HasSuffix(mcpRoute, "/") {
128+
mcpRoute += "/"
129+
}
124130
httpMux.Handle(mcpRoute, chainMiddleware(server.sseServer, middlewares...))
125131
httpServer.RegisterOnShutdown(func() {
126132
log.Printf("<%s> Shutting down", name)

0 commit comments

Comments
 (0)