Add support for request-received middleware
- Dominant language
- JavaScript
- Stars
- 8.2k
- Forks
- 565
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 12
Description
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()`.
The code at https://github.com/expressjs/morgan/blob/master/index.js#L506-L507 would change as follows:
```diff
- this._startAt = process.hrtime()
+ this._startAt = this[Symbol.for('request-received.startAt')] ? this[Symbol.for('request-received.startAt')] : process.hrtime()
- this._startTime = new Date()
+ this._startTime = this[Symbol.for('request-received.startTime')] ? this[Symbol.for('request-received.startTime')] : new Date()
```
Contributor guide
Assessment
This issue has not been assessed yet.