aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etherpad/src/etherpad/pro/pro_utils.js20
1 files changed, 9 insertions, 11 deletions
diff --git a/etherpad/src/etherpad/pro/pro_utils.js b/etherpad/src/etherpad/pro/pro_utils.js
index c539223..1dc2468 100644
--- a/etherpad/src/etherpad/pro/pro_utils.js
+++ b/etherpad/src/etherpad/pro/pro_utils.js
@@ -44,18 +44,16 @@ function getProRequestSubdomain() {
return d.split('.')[0];
}
-function getRequestSuperdomain() {
- var parts = request.domain.split('.').reverse();
- parts.pop(); // Remove one level
- while (parts.length > 0) {
- var domain = parts.reverse().join('.');
- if (SUPERDOMAINS[domain]) {
- return domain;
- }
- parts = parts.pop(); // Remove next level
+function getRequestSuperdomain() {
+ var parts = request.domain.split('.');
+ while (parts.length > 0) {
+ var domain = parts.join('.');
+ if (SUPERDOMAINS[domain]) {
+ return domain;
+ }
+ parts.shift(); // Remove next level
}
- return "foo";
-}
+}
function isProDomainRequest() {
// the result of this function never changes within the same request.