Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add support for request-received middleware #200

Copy link
Copy link
@niftylettuce

Description

@niftylettuce
Issue body actions

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:

-  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()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.