Skip to content

Commit

Permalink
Merge pull request #570 from roots/fix-reverse-www-for-www-domains
Browse files Browse the repository at this point in the history
Fix #569 Only skip subdomains for non-www domains
  • Loading branch information
swalkinshaw committed Apr 17, 2016
2 parents 79fdb34 + 3878399 commit 74081bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
### HEAD
* Fix #569 - Only skip subdomains for non-www domains ([#570](https://github.com/roots/trellis/pull/570))
* Enable Let's Encrypt to transition http sites to https ([#565](https://github.com/roots/trellis/pull/565))

### 0.9.7: April 10th, 2016
Expand Down
8 changes: 4 additions & 4 deletions lib/trellis/plugins/filter/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ def reverse_www(hosts, enabled=True, append=True):
elif isinstance(hosts, string_types):
host = hosts

if len(host.split('.')) > 2:
return host

if host.startswith('www.'):
return host[4:]
else:
return 'www.{0}'.format(host)
if len(host.split('.')) > 2:
return host
else:
return 'www.{0}'.format(host)

# Handle invalid input type
else:
Expand Down

0 comments on commit 74081bc

Please sign in to comment.