Skip to content

Commit dec1d38

Browse files
committed
Modules: added headers option to r.subrequest().
The option allows JavaScript code to pass custom request headers to subrequests: r.subrequest('/api', {headers: {'X-Token': secret}}) The option accepts a JavaScript object whose keys and values are added as request headers to the subrequest. Parent request headers are inherited by default; user-supplied headers override matching parent headers using case-insensitive comparison. Transport-level headers (Connection, Content-Length, Transfer-Encoding, Expect) supplied by the caller are silently ignored. When a body is provided, Content-Length is derived from the actual body size regardless of what the caller passes.
1 parent 3185ce8 commit dec1d38

2 files changed

Lines changed: 798 additions & 11 deletions

File tree

0 commit comments

Comments
 (0)