Closed rishavvajpayee closed 3 weeks ago
@lucifercr07 I would like to work on this issue could you please assign it to me
related PR : https://github.com/DiceDB/playground-mono/pull/13
Closing, merged as part of https://github.com/DiceDB/playground-mono/pull/13
Implement Cross-Origin Resource Sharing (CORS) middleware in the playground-mono backend to control which domains can access API resources. This will enhance security and allow flexible configurations for different environments
Create a CORS middleware in the middleware package: • Allow specific origins by setting Access-Control-Allow-Origin based on the environment configuration. • Include headers for allowed methods and allowed headers. • Handle OPTIONS requests with a proper 200 OK response.
Update LoadConfig() in the config package to support the new ALLOWED_ORIGINS configuration: • Parse a comma-separated string from an environment variable into a slice of strings.
Add CORS to all applicable routes in the main.go file or route initialization