express-middleware-headers-server-timing icon indicating copy to clipboard operation
express-middleware-headers-server-timing copied to clipboard

Version 1.9.1 introduced a bug that breaks addHeaders on express 4.17.1

Open Hallian opened this issue 3 years ago • 2 comments

Version 1.9.1 has introduced a bug that crashes the middleware by trying to access headers with response.headers. This will produce an error at least on express 4.17.1. I believe that the proper way of accessing the headers would be via response.get.

Error produced:

TypeError: Cannot read property 'server-timing' of undefined
    at ServerTiming.addHeaders (/home/phz/workspace/server-timing-header-bug/node_modules/server-timing-header/index.js:283:37)

Minimal example can be found at https://github.com/Hallian/server-timing-header-bug-minimal-example

Hallian avatar Nov 25 '21 09:11 Hallian

Came across the same issue. I guess it was introduced by this commit https://github.com/SilentImp/express-middleware-headers-server-timing/commit/320574c2a8c8e2c087e44cd49b58882bc40b6d06

maxceem avatar Jan 10 '22 14:01 maxceem

=___='' Ok, I need notifications. Will take a look at this shortly.

SilentImp avatar Mar 20 '24 11:03 SilentImp