Skip to content

Commit

Permalink
fix #98: fix rejectUnauthorized option value (#101)
Browse files Browse the repository at this point in the history
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 #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.

Co-authored-by: Toppi Giovanni Manuel <[email protected]>
  • Loading branch information
zijua and Toppi Giovanni Manuel authored Jul 29, 2022
1 parent f7bc612 commit 2205f50
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/assets/sitemapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default class Sitemapper {
this.debug = settings.debug;
this.concurrency = settings.concurrency || 10;
this.retries = settings.retries || 0;
this.rejectUnauthorized = settings.rejectUnauthorized || true;
this.rejectUnauthorized = settings.rejectUnauthorized === false ? false : true;
}

/**
Expand Down

0 comments on commit 2205f50

Please sign in to comment.