Skip to content

Commit 7ecffe1

Browse files
author
deiu
committed
[CORS] also expose Updates-Via
1 parent baca030 commit 7ecffe1

2 files changed

Lines changed: 2 additions & 8 deletions

File tree

lib/create-app.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var corsSettings = cors({
1414
methods: [
1515
'OPTIONS', 'HEAD', 'GET', 'PATCH', 'POST', 'PUT', 'DELETE'
1616
],
17-
exposedHeaders: 'User, Location, Link, Vary, Last-Modified, ETag, Accept-Patch, Content-Length',
17+
exposedHeaders: 'User, Location, Link, Vary, Last-Modified, ETag, Accept-Patch, Updates-Via, Content-Length',
1818
credentials: true,
1919
maxAge: 1728000,
2020
origin: true
@@ -46,12 +46,6 @@ function createApp (argv) {
4646
next()
4747
})
4848

49-
// Set default Allow methods
50-
app.use(function (req, res, next) {
51-
res.set('Allow', 'OPTIONS,HEAD,GET')
52-
next()
53-
})
54-
5549
// Session
5650
app.use(session(sessionSettings))
5751

test/http.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ describe('HTTP APIs', function () {
101101
.expect('Access-Control-Allow-Origin', 'http://example.com')
102102
.expect('Access-Control-Allow-Credentials', 'true')
103103
.expect('Access-Control-Allow-Methods', 'OPTIONS,HEAD,GET,PATCH,POST,PUT,DELETE')
104-
.expect('Access-Control-Expose-Headers', 'User, Location, Link, Vary, Last-Modified, ETag, Accept-Patch, Content-Length')
104+
.expect('Access-Control-Expose-Headers', 'User, Location, Link, Vary, Last-Modified, ETag, Accept-Patch, Updates-Via, Content-Length')
105105
.expect(204, done)
106106
})
107107

0 commit comments

Comments
 (0)