From ad588b086a7bf93eddf199166263b1d97fe73713 Mon Sep 17 00:00:00 2001 From: Carlos Anjos Date: Fri, 24 Feb 2023 17:32:44 +0000 Subject: [PATCH] Prevent Access-Control-Expose-Headers header to be overwritten --- src/server/router/plural.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/router/plural.js b/src/server/router/plural.js index 0e73dc399..9809fde5a 100644 --- a/src/server/router/plural.js +++ b/src/server/router/plural.js @@ -162,8 +162,8 @@ module.exports = (db, name, opts) => { // Slice result if (_end || _limit || _page) { - res.setHeader('X-Total-Count', chain.size()) - res.setHeader( + res.append('X-Total-Count', chain.size()) + res.append( 'Access-Control-Expose-Headers', `X-Total-Count${_page ? ', Link' : ''}`, )