Skip to content

OPTION CORS not allowed #12

@docsa

Description

@docsa

I currently write an ember.js client for this API.
browsers send an OPTIONS request before any access.
Could you add those lines after line #45 in index.js ?

  res.set('Access-Control-Allow-Origin', '*');
  // add CORS compliance
  res.set('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS');
  res.set('Access-Control-Allow-Headers', 'Content-Type, Accept, Authorization, Content-Length, X-Requested-With');

// intercept OPTIONS method
if ('OPTIONS' == req.method) {
  res.send(200);
}
else {
  next();
}

(I tried au pull request but i am not allowed to push)
Thanks
Alain

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions