-
-
Notifications
You must be signed in to change notification settings - Fork 608
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #569 Only skip subdomains for non-www domains
The logic to skip the reversing functionality for subdomains was also affecting domains starting with `www`. Now it correctly leaves `www` domains alone and only skips other subdomains.
- Loading branch information
1 parent
79fdb34
commit 3878399
Showing
2 changed files
with
5 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3878399
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@swalkinshaw, sorry if it's not the way to mention this bug. Watch out for line 32
if len(host.split('.')) > 2:
when we have international domains in our hosts (like com.ar, co.uk, etc) www is not added because the conditional returns true.
So if you have a domain like domain.com.ar you will not have the www redirect because the condition think it is a subdomain.
If I get to a solution I'll post it asap.
Thanks!
3878399
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jdebuchy thanks for pointing this out. Unfortunately there's no easy way of solving this problem. The only reliable way to do it (in code) is to have a list of TLDs and check them all. There's some python libraries which handle it but Ansible doesn't make it easy to use external dependencies.
3878399
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the answer @swalkinshaw, and sad to hear there is no easy solution for this. If I find a walk-around to it, I'll let you know. Unfortunately, I work with many clients who uses these TLDs :(.