Skip to content

Commit

Permalink
append new server-timing headers to those added upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
cvazac committed Jul 28, 2017
1 parent 9d6ecf9 commit bf8f897
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ module.exports = function serverTiming (options) {
headers.push(`total=${timeSec}; "Total Response Time"`)
}
timer.clear()
res.setHeader('Server-Timing', headers.join(', '))

const existingHeaders = res.getHeader('Server-Timing')
res.setHeader('Server-Timing', [].concat(existingHeaders || []).concat(headers).join(', '))
})
if (typeof next === 'function') {
next()
Expand Down

0 comments on commit bf8f897

Please sign in to comment.