How do I customize cors in v4

System Information
  • **Strapi Version **: v4
  • Operating System: wsl linux
  • Database:
  • **Node Version **: 16
  • **NPM Version **: 6.14.16
  • Yarn Version: 1.22.19

I just want to limit my cors to a few URLs.

I’ve tried:

in config/server

  settings: {
    cors: {
      enabled: false,
      origin: ["http://test.com"],
    },
  },

In config/middleware.js

  { name: "stapi::cors", config: { origin: ["http://test.com"] } },

Neither of these solutions have worked. I am able to successfully make requests from localhost:3000