Skip to content

Commit

Permalink
Merge pull request #11 from cvazac/master
Browse files Browse the repository at this point in the history
append new server-timing headers to those added upstream
  • Loading branch information
yosuke-furukawa committed Aug 2, 2017
2 parents 9d6ecf9 + bf8f897 commit 30c7ee3
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 30c7ee3

Please sign in to comment.