mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-28 03:40:25 +01:00
handle xsns.jp as a special suffix
This commit is contained in:
parent
3a84635186
commit
3c8829ba10
2 changed files with 8 additions and 0 deletions
|
@ -131,6 +131,12 @@ export class UtilityService {
|
|||
return mastoHost[1];
|
||||
}
|
||||
|
||||
// XServer SNS
|
||||
const xserverSns = hostname.match(/\.?([a-zA-Z0-9-]+\.xsns\.jp)$/i);
|
||||
if (xserverSns) {
|
||||
return xserverSns[1];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -38,6 +38,8 @@ describe('UtilityService', () => {
|
|||
test('special', () => {
|
||||
assert.equal(utilityService.punyHostPSLDomain('http://foo.masto.host'), 'foo.masto.host');
|
||||
assert.equal(utilityService.punyHostPSLDomain('http://foo.bar.masto.host'), 'bar.masto.host');
|
||||
assert.equal(utilityService.punyHostPSLDomain('http://foo.xsns.jp'), 'foo.xsns.jp');
|
||||
assert.equal(utilityService.punyHostPSLDomain('http://foo.bar.xsns.jp'), 'bar.xsns.jp');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue