Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #98: fix rejectUnauthorized option value #101

Merged

Conversation

zijua
Copy link
Contributor

@zijua zijua commented Feb 28, 2022

The current value for rejectUnauthorized is set in this way:

this.rejectUnauthorized = settings.rejectUnauthorized || true;

but if in the constructor we pass the value false it will resolve in false || true which is true.
I've tested this change and it seems to work when using self-signed SSL certificates.

This commit will only include the src file as I don't know if to include the compiled assets.

note: in the issue #98 @AntonKrutikov suggested this change

this.rejectUnauthorized = settings.rejectUnauthorized ?? true;

but it will not be transpiled correctly so I used the "old fashion" style and npm run compile worked correctly.

The current value for rejectUnauthorized is set in this way:

```javascript
this.rejectUnauthorized = settings.rejectUnauthorized || true;
```

but if in the constructor we pass the value `false` it will resolve in `false || true` which is true.
I've tested this change and it seems to work when using self-signed SSL certificates.

This commit will only include the src file as I don't know if to include the compiled assets.

note: in the issue seantomburke#98 @AntonKrutikov suggested this change

```javascript
this.rejectUnauthorized = settings.rejectUnauthorized ?? true;
```

but it will not be transpiled correctly so I used the "old fashion" style and `npm run compile` worked correctly.
Copy link
Owner

@seantomburke seantomburke left a comment

Choose a reason for hiding this comment

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

Great find!

@seantomburke
Copy link
Owner

We'll need to generate the files though, I can create a follow up PR commit to have those changes propagate

@seantomburke seantomburke merged commit 2205f50 into seantomburke:master Jul 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants