I'm working with an Angular front and a NodeJS API that actually run in prod with some aws services (S3 and Elastic Beanstalk).
I actually get this CORS error when I'm uploading an image that seems to be to heavy or when I upload more thant two images, each taking 200Ko.
Of course, I have already set my headers and I shouldn't have any issue with CORS, the issue there is about some req size limitation. There is some parts of my app.js.
app.use(bodyParser.json({}));
app.use(bodyParser.urlencoded({ extended: false }));
app.use("/images", express.static(path.join("images")));
app.use((req, res, next) => {
res.setHeader("Access-Control-Allow-Origin", "*");
res.setHeader(
"Access-Control-Allow-Headers",
"Origin, X-Requested-With, Content-type, Accept, Authorization"
);
res.setHeader(
"Access-Control-Allow-Methods",
"GET, POST, PATCH, PUT, DELETE, OPTIONS"
);
next();
});
THX !