Skip to content

Commit f835007

Browse files
committedNov 29, 2017
refactor: set all options at once
there is no problems setting `agent` or `rejectUnauthorized` to undefined
1 parent 97930c9 commit f835007

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed
 

‎lib/index.js

+3-13
Original file line numberDiff line numberDiff line change
@@ -712,25 +712,15 @@ var Client = module.exports = function (config) {
712712
headers.host = queryAndUrl.host || host
713713

714714
var options = {
715+
agent: agent,
715716
host: headers.host,
716717
port: port,
717718
path: path,
718719
method: method,
719720
headers: headers,
720721
ca: ca,
721-
family: this.config.family
722-
}
723-
724-
// agent will be handled differently soon: https://github.com/octokit/node-github/issues/656
725-
/* istanbul ignore if */
726-
if (agent) {
727-
options.agent = agent
728-
}
729-
730-
// certificates will be handled differently soon: https://github.com/octokit/node-github/issues/656
731-
/* istanbul ignore if */
732-
if (this.config.rejectUnauthorized !== undefined) {
733-
options.rejectUnauthorized = this.config.rejectUnauthorized
722+
family: this.config.family,
723+
rejectUnauthorized: this.config.rejectUnauthorized
734724
}
735725

736726
debug('REQUEST:', options)

0 commit comments

Comments
 (0)
Please sign in to comment.