Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,22 @@ export default class UploadPlugin extends AdminForthPlugin {
return { ok: true };
};

async isInternalUrl(url: string): Promise<boolean> {
const adapter = this.options.storageAdapter as any;

if (adapter && typeof adapter.isInternalUrl === 'function') {
try {
return await adapter.isInternalUrl(url);
} catch (err) {
console.error(`[UploadPlugin] Error calling isInternalUrl on adapter:`, err);
return false;
}
} else {
throw new Error ('Plese update storage adapter')
}
return false;
}

instanceUniqueRepresentation(pluginOptions: any) : string {
return `${pluginOptions.pathColumnName}`;
}
Expand Down