mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-21 07:38:07 +02:00
Add tests for file names with spaces and semicolons
This commit is contained in:
parent
2f19d9d906
commit
911659cd70
1 changed files with 18 additions and 0 deletions
|
@ -174,11 +174,29 @@ describe('network_utils', function() {
|
|||
}
|
||||
})).toEqual('filename.pdf');
|
||||
|
||||
expect(extractFilenameFromHeader((headerName) => {
|
||||
if (headerName === 'Content-Disposition') {
|
||||
return 'attachment; filename="filename.pdf and spaces.pdf"';
|
||||
}
|
||||
})).toEqual('filename.pdf and spaces.pdf');
|
||||
|
||||
expect(extractFilenameFromHeader((headerName) => {
|
||||
if (headerName === 'Content-Disposition') {
|
||||
return 'attachment; filename="tl;dr.pdf"';
|
||||
}
|
||||
})).toEqual('tl;dr.pdf');
|
||||
|
||||
expect(extractFilenameFromHeader((headerName) => {
|
||||
if (headerName === 'Content-Disposition') {
|
||||
return 'attachment; filename=filename.pdf';
|
||||
}
|
||||
})).toEqual('filename.pdf');
|
||||
|
||||
expect(extractFilenameFromHeader((headerName) => {
|
||||
if (headerName === 'Content-Disposition') {
|
||||
return 'attachment; filename=filename.pdf someotherparam';
|
||||
}
|
||||
})).toEqual('filename.pdf');
|
||||
});
|
||||
|
||||
it('gets the filename from the response header (RFC 6266)', function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue