Extra GET requests before POST request which my code doesn't

Only in production, and never locally, did the super agent seem to make an additional GET request right before the POST request. This is similar to this unanswered question , however when using other software it is just a super agent.

Client code is a simple POST request:

superagent
.post('/api/v1/csr/whois')
.send({
    someKey: someValue
})
.end(function(res){
    log('Whois response:', res)
})
0
source share
1 answer

This is Cross Origin-based query sharing.

Additional GET requests - pre-flight CORS requests . This has been fixed in the node / express application using:

var cors = require('cors');
app.use(cors());
0
source

Source: https://habr.com/ru/post/1765025/


All Articles