(input, options, callback)
| 25342 | var nativeProtocol = nativeProtocols[protocol] = protocols[scheme]; |
| 25343 | var wrappedProtocol = exports3[scheme] = Object.create(nativeProtocol); |
| 25344 | function request3(input, options, callback) { |
| 25345 | if (isURL(input)) { |
| 25346 | input = spreadUrlObject(input); |
| 25347 | } else if (isString2(input)) { |
| 25348 | input = spreadUrlObject(parseUrl(input)); |
| 25349 | } else { |
| 25350 | callback = options; |
| 25351 | options = validateUrl(input); |
| 25352 | input = { protocol }; |
| 25353 | } |
| 25354 | if (isFunction4(options)) { |
| 25355 | callback = options; |
| 25356 | options = null; |
| 25357 | } |
| 25358 | options = Object.assign({ |
| 25359 | maxRedirects: exports3.maxRedirects, |
| 25360 | maxBodyLength: exports3.maxBodyLength |
| 25361 | }, input, options); |
| 25362 | options.nativeProtocols = nativeProtocols; |
| 25363 | if (!isString2(options.host) && !isString2(options.hostname)) { |
| 25364 | options.hostname = "::1"; |
| 25365 | } |
| 25366 | assert2.equal(options.protocol, protocol, "protocol mismatch"); |
| 25367 | debug5("options", options); |
| 25368 | return new RedirectableRequest(options, callback); |
| 25369 | } |
| 25370 | function get(input, options, callback) { |
| 25371 | var wrappedRequest = wrappedProtocol.request(input, options, callback); |
| 25372 | wrappedRequest.end(); |
nothing calls this directly
no test coverage detected
searching dependent graphs…