feat: add CORS support to registry API (#711)
Fixes #710 This PR adds CORS middleware to enable browser-based clients and web applications to access the registry API. ## Changes - Add CORSMiddleware in internal/api/cors.go to handle preflight OPTIONS requests and inject CORS headers - Integrate CORS middleware into the server middleware stack - Add CORS configuration options (CORS_ENABLED and CORS_ALLOWED_ORIGIN) ## Testing - All existing tests pass - Manual testing confirms CORS headers are present in responses - OPTIONS preflight requests now return 204 with proper headers ## Configuration New environment variables: - MCP_REGISTRY_CORS_ENABLED (default: true) - MCP_REGISTRY_CORS_ALLOWED_ORIGIN (default: *)
This commit is contained in:
parent
237758b081
commit
73d2174cec
1 changed files with 213 additions and 2 deletions
1
go.mod
1
go.mod
|
|
@ -41,6 +41,7 @@ require (
|
|||
github.com/prometheus/common v0.66.1 // indirect
|
||||
github.com/prometheus/otlptranslator v0.0.2 // indirect
|
||||
github.com/prometheus/procfs v0.17.0 // indirect
|
||||
github.com/rs/cors v1.11.1 // indirect
|
||||
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.38.0 // indirect
|
||||
go.yaml.in/yaml/v2 v2.4.2 // indirect
|
||||
|
|
|
|||
Loading…
Reference in a new issue