user3524743
user3524743

Reputation: 97

How to access header keys from inside swagger-tools controllers?

When a parameter is defined to be 'in' header, then swagger-tools makes it available to controllers via 'args' variable, but other header's keys will not be included.

My question is: how to read header keys and values that are not specifically defined in 'parameters' section, such as 'cache-control' or 'X-Requested-With'?

Upvotes: 0

Views: 472

Answers (1)

Aleksei Momot
Aleksei Momot

Reputation: 79

Request headers are included in:

res.socket.parser.incoming.headers

Upvotes: 2

Related Questions