Skip to content

Version 1.9.1 introduced a bug that breaks addHeaders on express 4.17.1 #35

@Hallian

Description

@Hallian

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions