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 #76

Closed
niftylettuce opened this issue Jun 13, 2019 · 0 comments
Closed

Add support for request-received middleware #76

niftylettuce opened this issue Jun 13, 2019 · 0 comments

Comments

@niftylettuce
Copy link
Contributor

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 a new Date().

e.g. https://github.com/koajs/logger/blob/master/index.js#L59 would change from const start = Date.now() to const start = ctx[Symbol.for('request-received.startTime')] ? ctx[Symbol.for('request-received.startTime')].getTime() : Date.now()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant