Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for request-received middleware #19

Open
niftylettuce opened this issue Jun 13, 2019 · 4 comments
Open

Add support for request-received middleware #19

niftylettuce opened this issue Jun 13, 2019 · 4 comments
Labels

Comments

@niftylettuce
Copy link

niftylettuce commented Jun 13, 2019

The request-received middleware at https://github.com/cabinjs/request-received exposes a Symbol.for property, which this package could conditionally consume if interested (as opposed to just generating process.hrtime().

e.g. https://github.com/expressjs/response-time/blob/master/index.js#L53 would change from var startAt = process.hrtime() to var startAt = req[Symbol.for('request-received.startAt')] ? req[Symbol.for('request-received.startAt')] : process.hrtime()

@niftylettuce
Copy link
Author

@dougwilson see #20

@niftylettuce
Copy link
Author

Note that Symbol is not supported in v0.8 and v0.10, therefore I have changed engine and .travis.yml to support v0.12.0+

@niftylettuce
Copy link
Author

Note that I am open to moving request-received to expressjs organization if need be.

@niftylettuce
Copy link
Author

And/or if we could add these two Symbols internally to Express automatically?

@ryhinchey ryhinchey added the pr label Feb 28, 2020
@dougwilson dougwilson added ideas and removed pr labels Jul 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants