Skip to content

Commit 2b93bf5

Browse files
Vahid Panjganjtypicode
authored andcommitted
Exposing Link in the header instead of Links (typicode#394)
- fix the small typo `Links` to `Link` - update relevant tests
1 parent 0dbb5ba commit 2b93bf5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/server/router/plural.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ module.exports = function (db, name) {
153153
// Slice result
154154
if (_end || _limit || _page) {
155155
res.setHeader('X-Total-Count', chain.size())
156-
res.setHeader('Access-Control-Expose-Headers', 'X-Total-Count' + (_page ? ', Links' : ''))
156+
res.setHeader('Access-Control-Expose-Headers', 'X-Total-Count' + (_page ? ', Link' : ''))
157157
}
158158

159159
if (_page) {

test/server/plural.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ describe('Server', function () {
261261
.get('/list?_page=2')
262262
.expect('Content-Type', /json/)
263263
.expect('x-total-count', db.list.length.toString())
264-
.expect('Access-Control-Expose-Headers', 'X-Total-Count, Links')
264+
.expect('Access-Control-Expose-Headers', 'X-Total-Count, Link')
265265
.expect(db.list.slice(10, 20))
266266
.expect(200, done)
267267
})
@@ -281,7 +281,7 @@ describe('Server', function () {
281281
.expect('Content-Type', /json/)
282282
.expect('x-total-count', db.list.length.toString())
283283
.expect('link', link)
284-
.expect('Access-Control-Expose-Headers', 'X-Total-Count, Links')
284+
.expect('Access-Control-Expose-Headers', 'X-Total-Count, Link')
285285
.expect(db.list.slice(1, 2))
286286
.expect(200, done)
287287
})

0 commit comments

Comments
 (0)