Skip to content

Commit

Permalink
chore: set rejectUnauthorized for api calls (#24087)
Browse files Browse the repository at this point in the history
  • Loading branch information
mschile authored Oct 4, 2022
1 parent ed35eaa commit d9c5e57
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/server/lib/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const rp = request.defaults((params = {}, callback) => {
proxy: null,
gzip: true,
cacheable: false,
rejectUnauthorized: true,
})

const headers = params.headers != null ? params.headers : (params.headers = {})
Expand Down
14 changes: 14 additions & 0 deletions packages/server/test/unit/api_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,20 @@ describe('lib/api', () => {
})
})

it('sets rejectUnauthorized on the request', () => {
nock.cleanAll()

return api.ping()
.thenThrow()
.catch(() => {
expect(agent.addRequest).to.be.calledOnce

expect(agent.addRequest).to.be.calledWithMatch(sinon.match.any, {
rejectUnauthorized: true,
})
})
})

context('with a proxy defined', () => {
beforeEach(function () {
nock.cleanAll()
Expand Down

4 comments on commit d9c5e57

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on d9c5e57 Oct 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.10.0/linux-x64/develop-d9c5e576728498ccef05193599fe3cd982d59b69/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on d9c5e57 Oct 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux arm64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.10.0/linux-arm64/develop-d9c5e576728498ccef05193599fe3cd982d59b69/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on d9c5e57 Oct 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.10.0/darwin-x64/develop-d9c5e576728498ccef05193599fe3cd982d59b69/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on d9c5e57 Oct 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the win32 x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.10.0/win32-x64/develop-d9c5e576728498ccef05193599fe3cd982d59b69/cypress.tgz

Please sign in to comment.