mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
fix(api): resolve allowed_domains redis bug
This commit is contained in:
@@ -195,7 +195,7 @@ describe('SettingService', () => {
|
||||
expect(settingService.find).toHaveBeenCalledWith({
|
||||
label: 'allowed_domains',
|
||||
});
|
||||
expect(result).toEqual(new Set(['*', 'https://example.com']));
|
||||
expect(result).toEqual(['*', 'https://example.com']);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -135,7 +135,7 @@ export class SettingService extends BaseService<Setting> {
|
||||
* @returns A promise that resolves to a set of allowed origins
|
||||
*/
|
||||
@Cacheable(ALLOWED_ORIGINS_CACHE_KEY)
|
||||
async getAllowedOrigins() {
|
||||
async getAllowedOrigins(): Promise<string[]> {
|
||||
const settings = (await this.find({
|
||||
label: 'allowed_domains',
|
||||
})) as TextSetting[];
|
||||
@@ -150,7 +150,7 @@ export class SettingService extends BaseService<Setting> {
|
||||
...allowedDomains,
|
||||
]);
|
||||
|
||||
return uniqueOrigins;
|
||||
return Array.from(uniqueOrigins);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user