File tree Expand file tree Collapse file tree
packages/plugin-document-manager/src/lib Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ ' @embedpdf/plugin-document-manager ' : patch
3+ ---
4+
5+ Fixed document name extraction to always include ` .pdf ` extension when extracting filename from URL.
Original file line number Diff line number Diff line change @@ -589,8 +589,12 @@ export class DocumentManagerPlugin extends BasePlugin<
589589 try {
590590 const urlObj = new URL ( url ) ;
591591 const pathname = urlObj . pathname ;
592- const filename = pathname . split ( '/' ) . pop ( ) || 'document.pdf' ;
593- return decodeURIComponent ( filename ) ;
592+ let filename = pathname . split ( '/' ) . pop ( ) || 'document.pdf' ;
593+ filename = decodeURIComponent ( filename ) ;
594+ if ( ! filename . toLowerCase ( ) . endsWith ( '.pdf' ) ) {
595+ filename += '.pdf' ;
596+ }
597+ return filename ;
594598 } catch {
595599 return 'document.pdf' ;
596600 }
You can’t perform that action at this time.
0 commit comments