diff options
author | Jeff Mitchell <etherpad@jefferai.org> | 2010-04-07 18:39:11 -0400 |
---|---|---|
committer | Jeff Mitchell <etherpad@jefferai.org> | 2010-04-07 18:39:11 -0400 |
commit | 6dbb148634b9cde9581708b652a49b195b58e484 (patch) | |
tree | 92e58fbaa0bb0537cc34b11190a202fd960b234f | |
parent | cc79f0e2c6b9452b2f0a8224d12421745c7ab134 (diff) | |
download | etherpad-6dbb148634b9cde9581708b652a49b195b58e484.tar.gz etherpad-6dbb148634b9cde9581708b652a49b195b58e484.tar.xz etherpad-6dbb148634b9cde9581708b652a49b195b58e484.zip |
Instead of only working with superdomains that have two parts, consume each part of the request and compare against valid superdomains. This lets you run a site with arbitrary lengths for the domains, e.g. mypads.etherpad.mysite.com.
-rw-r--r-- | etherpad/src/etherpad/pro/pro_utils.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/etherpad/src/etherpad/pro/pro_utils.js b/etherpad/src/etherpad/pro/pro_utils.js index 5e8b801..3c5a7c9 100644 --- a/etherpad/src/etherpad/pro/pro_utils.js +++ b/etherpad/src/etherpad/pro/pro_utils.js @@ -47,11 +47,14 @@ function getProRequestSubdomain() { function getRequestSuperdomain() { var parts = request.domain.split('.'); - parts.reverse(); - if (parts[0] == ".") { + while (parts.length > 0) { + var domain = parts.join('.'); + if (SUPERDOMAINS[domain]) { + return domain; + } parts.shift(); } - return [parts[1], parts[0]].join('.'); + return false; } function isProDomainRequest() { |