fix: add parser Public Suffix List for naming domain file config and fix failed to remove old legacy file config
This commit is contained in:
1 parent
af92445c6c
commit
17cbc2fb98
5 files changed
+148
-1
No files matched your search
@@ -5,6 +5,7 @@ import {
|
||||
buildManagedNginxFileBase,
|
||||
buildManagedNginxSharedFileBase,
|
||||
getDomainConfigAnchor,
|
||||
getLegacyTwoLabelDomainConfigAnchor,
|
||||
} from "../../src/server/services/domain-provisioning/names";
|
||||
|
||||
test("isolated nginx config uses a single domain file name", () => {
|
||||
@@ -48,3 +49,28 @@ test("shared nginx config anchor keeps service files separate across roots", ()
|
||||
"example.com",
|
||||
);
|
||||
});
|
||||
|
||||
test("shared nginx config anchor respects public suffix domains", () => {
|
||||
assert.equal(
|
||||
getDomainConfigAnchor(["stream.appku.web.id"]),
|
||||
"appku.web.id",
|
||||
);
|
||||
|
||||
assert.equal(getDomainConfigAnchor(["api.appku.co.id"]), "appku.co.id");
|
||||
assert.equal(
|
||||
getDomainConfigAnchor(["foo.example.co.uk"]),
|
||||
"example.co.uk",
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
buildManagedNginxSharedFileBase("livestream-app", [
|
||||
"stream.appku.web.id",
|
||||
]),
|
||||
"appku.web.id",
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
getLegacyTwoLabelDomainConfigAnchor(["stream.appku.web.id"]),
|
||||
"web.id",
|
||||
);
|
||||
});
|
||||
Reference in new issue
Block a user