Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'Accept' to default header per #2855 #2858

Merged
merged 3 commits into from Oct 20, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion API.md
Expand Up @@ -2110,7 +2110,7 @@ following options:
('Access-Control-Max-Age'). The greater the value, the longer it will take before the
browser checks for changes in policy. Defaults to `86400` (one day).
- `headers` - a strings array of allowed headers ('Access-Control-Allow-Headers').
Defaults to `['Authorization', 'Content-Type', 'If-None-Match']`.
Defaults to `['Accept', 'Authorization', 'Content-Type', 'If-None-Match']`.
- `additionalHeaders` - a strings array of additional headers to `headers`. Use this to
keep the default headers in place.
- `exposedHeaders` - a strings array of exposed headers
Expand Down
1 change: 1 addition & 0 deletions lib/defaults.js
Expand Up @@ -82,6 +82,7 @@ exports.cors = {
origin: ['*'],
maxAge: 86400, // One day
headers: [
'Accept',
'Authorization',
'Content-Type',
'If-None-Match'
Expand Down
2 changes: 1 addition & 1 deletion test/cors.js
Expand Up @@ -527,7 +527,7 @@ describe('CORS', function () {
}, function (res) {

expect(res.statusCode).to.equal(200);
expect(res.headers['access-control-allow-headers']).to.equal('Authorization,Content-Type,If-None-Match');
expect(res.headers['access-control-allow-headers']).to.equal('Accept,Authorization,Content-Type,If-None-Match');
done();
});
});
Expand Down