Skip to content

Commit

Permalink
fix: over-eager zone matching
Browse files Browse the repository at this point in the history
Closes #16
  • Loading branch information
Cherry committed Jun 7, 2020
1 parent 450850f commit a59961b
Show file tree
Hide file tree
Showing 4 changed files with 208 additions and 201 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.2.3] - 2020-06-07
- Fix over-eager zone matching that could cause certs for `testing-example.com` to fail if domain `example.com` was available

## [1.2.2] - 2020-05-09
- Improve Cloudflare error response handling

Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ class Challenge {

async getZoneForDomain(domain){
for await(const zone of consumePages(pagination => this.client.zones.browse(pagination))){
if(domain.endsWith(zone.name)){
if(domain === zone.name || domain.endsWith(`.${zone.name}`)){
return zone;
}
}
Expand Down
Loading

0 comments on commit a59961b

Please sign in to comment.