mirror of
https://github.com/typicode/json-server.git
synced 2025-07-27 20:23:34 +08:00
Expose the Links header. (#381)
This commit is contained in:
@ -153,7 +153,7 @@ module.exports = function (db, name) {
|
|||||||
// Slice result
|
// Slice result
|
||||||
if (_end || _limit || _page) {
|
if (_end || _limit || _page) {
|
||||||
res.setHeader('X-Total-Count', chain.size())
|
res.setHeader('X-Total-Count', chain.size())
|
||||||
res.setHeader('Access-Control-Expose-Headers', 'X-Total-Count')
|
res.setHeader('Access-Control-Expose-Headers', 'X-Total-Count' + (_page ? ', Links' : ''))
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_page) {
|
if (_page) {
|
||||||
|
Reference in New Issue
Block a user