CORS: Cannot use wildcard in Access-Control-Allow-Origin when credentials flag is true

后端 未结 9 2532
借酒劲吻你
借酒劲吻你 2020-11-22 01:54

I have a setup involving

Frontend server (Node.js, domain: localhost:3000) <---> Backend (Django, Ajax, domain: localhost:8000)

Browser <-- webapp <

9条回答
  •  梦谈多话
    2020-11-22 02:39

    try it:

    const cors = require('cors')
    
    const corsOptions = {
        origin: 'http://localhost:4200',
        credentials: true,
    
    }
    app.use(cors(corsOptions));
    

提交回复
热议问题