Skip to content
This repository has been archived by the owner on Nov 19, 2021. It is now read-only.

Commit

Permalink
Add cors pre-flight handling
Browse files Browse the repository at this point in the history
  • Loading branch information
maxpowa committed Apr 13, 2016
1 parent 9b42563 commit 07254bb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions routes/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ var storage = multer.diskStorage({

var upload = multer({ storage: storage, limits: {fileSize: config.MAX_UPLOAD_SIZE}, fileFilter: util.fileFilter });


/* Handle CORS pre-flight requests */
router.options('/', cors());

/* POST upload page. */
router.post('/', cors(), upload.array('files[]', config.MAX_UPLOAD_COUNT), function(req, res, next) {
var files = [];
Expand Down

0 comments on commit 07254bb

Please sign in to comment.