Fixed linter errors and fixed tests

- Added error handling for JSON encoding in ServersHandler and ServersDetailHandler.
- Updated test cases to reflect changes in handler functions and improved mock expectations.
- Refactored server initialization to include ReadHeaderTimeout for better request handling.
- Modified GitHubDeviceAuth to accept context in ValidateToken and checkOrgMembership methods.
- Improved error messages in database import functions for better debugging.
- Updated memory and mongo database list functions to accept context and improved filtering logic.
- Enhanced logging in publisher tool for better visibility during execution.
- Cleaned up code formatting and comments for better readability and maintainability.
This commit is contained in:
Avinash Sridhar 2025-05-27 18:57:59 -04:00 • committed by Toby Padilla
commit b6c141a721

View file

@ -4,6 +4,7 @@ import (
"context"
"log"
"net/http"
"time"
"github.com/modelcontextprotocol/registry/internal/api/router"
"github.com/modelcontextprotocol/registry/internal/auth"
@ -31,8 +32,9 @@ func NewServer(cfg *config.Config, registryService service.RegistryService, auth
authService: authService,
router: mux,
server: &http.Server{
Addr: cfg.ServerAddress,
Handler: mux,
Addr: cfg.ServerAddress,
Handler: mux,
ReadHeaderTimeout: 10 * time.Second,
},
}