We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ff111f2 commit 0d470e3Copy full SHA for 0d470e3
index.ts
@@ -164,9 +164,15 @@ export default class UploadPlugin extends AdminForthPlugin {
164
165
async isInternalUrl(url: string): Promise<boolean> {
166
const adapter = this.options.storageAdapter as any;
167
-
168
if (adapter && typeof adapter.isInternalUrl === 'function') {
169
try {
+ if(this.options.preview?.previewUrl) {
170
+ const previewUrl = this.options.preview.previewUrl({ filePath: 'test_filepath' });
171
+ if (url.startsWith(previewUrl.replace('test_filepath', ''))) {
172
+ return true;
173
+ }
174
+ return false;
175
176
return await adapter.isInternalUrl(url);
177
} catch (err) {
178
console.error(`[UploadPlugin] Error calling isInternalUrl on adapter:`, err);
0 commit comments