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

rejectUnauthorized not applied (always true) #98

Closed
AntonKrutikov opened this issue Feb 14, 2022 · 0 comments
Closed

rejectUnauthorized not applied (always true) #98

AntonKrutikov opened this issue Feb 14, 2022 · 0 comments

Comments

@AntonKrutikov
Copy link

this.rejectUnauthorized = settings.rejectUnauthorized || true;

This option will be alway true

Can be like this: this.rejectUnauthorized = settings.rejectUnauthorized ?? true;

zijua pushed a commit to zijua/sitemapper that referenced this issue Feb 28, 2022
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant