-
Notifications
You must be signed in to change notification settings - Fork 136
Closed
Description
Context
Express v5 (source) and v4 (source) request objects have a get method - a case-insensitive way to get a request header. req.get is a widely used method for safely getting request headers.
Issue
As of v1.17.1 I have failing unit tests with:
TypeError: mockRequest.headers.get is not a function
Previous version v1.17.0 did not exhibit this issue. In v1.17.0, mockRequest.getHeader was a standalone method (did not call mockRequest.headers.get).
As of v1.17.1, mockRequest.getHeader was refactored to call mockRequest.headers.get (source). As far as I can tell, objects returned from createHeaders should have get methods.
Metadata
Metadata
Assignees
Labels
No labels