Skip to content

Commit

Permalink
Merge pull request expressjs#17 from typicode/master
Browse files Browse the repository at this point in the history
Add PATCH to defaults methods
  • Loading branch information
troygoode committed May 6, 2014
2 parents 6a6fbb1 + e4afa9e commit 3a285f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

var defaults = {
origin: '*',
methods: 'GET,HEAD,PUT,POST,DELETE'
methods: 'GET,HEAD,PUT,PATCH,POST,DELETE'
};

function configureOrigin(options, req) {
Expand Down
6 changes: 3 additions & 3 deletions test/cors.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
next = function () {
// assert
res.getHeader('Access-Control-Allow-Origin').should.equal('*');
res.getHeader('Access-Control-Allow-Methods').should.equal('GET,PUT,POST,DELETE');
res.getHeader('Access-Control-Allow-Methods').should.equal('GET,PUT,PATCH,POST,DELETE');
done();
};

Expand Down Expand Up @@ -288,7 +288,7 @@
cors(options)(req, res, next);
});

it('methods defaults to GET, PUT, POST, DELETE', function (done) {
it('methods defaults to GET, PUT, PATCH, POST, DELETE', function (done) {
// arrange
var req, res, next, options;
options = {
Expand All @@ -303,7 +303,7 @@
};
next = function () {
// assert
res.getHeader('Access-Control-Allow-Methods').should.equal('GET,PUT,POST,DELETE');
res.getHeader('Access-Control-Allow-Methods').should.equal('GET,PUT,PATCH,POST,DELETE');
done();
};

Expand Down

0 comments on commit 3a285f7

Please sign in to comment.