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

后端 未结 9 2506
借酒劲吻你
借酒劲吻你 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:34

    If you are using CORS middleware and you want to send withCredential boolean true, you can configure CORS like this:

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

提交回复
热议问题