question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add options to override more of the HTTP Request options, like,

  • auth as a separate option {auth: { user: <user>, pass: <pass> } }
  • etc…

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
silascommented, Jun 16, 2015

These options are just the normal node https options. In order to use rejectUnauthorized you must pass in an Agent (or disabled it) as the global http agent ignores it by default (obviously you can disable auth globally as well).

See the https.request options for more details (scroll down a bit):

https://nodejs.org/api/https.html#https_https_request_options_callback

Something like the following should work:

new require('jenkins')({
  baseUrl: 'https://user:pass@jenkins_url',
  timeout: 5000,
  rejectUnauthorized: false,
  agent: new require('https').Agent(),
})
0reactions
uccmencommented, Jan 26, 2017

thanks for effort on trying it out @silas . I checked with my ops team and they shared that our jenkins server is behind a proxy… They’ll get back to me once they updated some “rules” so I can retrieve jobs using api token.

Read more comments on GitHub >

github_iconTop Results From Across the Web

OPTIONS - HTTP - MDN Web Docs
The HTTP OPTIONS method requests permitted communication options for a given URL or server. A client can specify a URL with this method, ......
Read more >
What is HTTP OPTIONS Method? - ReqBin
HTTP OPTIONS requests allow clients to obtain parameters and requirements for specific resources and server capabilities without taking action ...
Read more >
Request Options - Guzzle Documentation
Request options control various aspects of a request including, headers, query string parameters, timeout settings, the body of a request, and much more....
Read more >
Why Is an OPTIONS Request Sent? - Baeldung
The OPTIONS request mentioned in the introduction is a preflight request, which is part of the CORS (Cross-Origin Resource Sharing).
Read more >
Why am I getting an OPTIONS request instead of a GET ...
According to MDN,. Preflighted requests. Unlike simple requests (discussed above), "preflighted" requests first send an HTTP OPTIONS request ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found