From 5d902244093970d9e4f0896f6cac7f83351484ee Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Wed, 16 Jan 2019 11:30:36 +0100 Subject: [PATCH] Add a unit-test for issue 10395 (PR 10398 follow-up) --- test/unit/metadata_spec.js | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/test/unit/metadata_spec.js b/test/unit/metadata_spec.js index 01a992702..2abadc139 100644 --- a/test/unit/metadata_spec.js +++ b/test/unit/metadata_spec.js @@ -128,6 +128,37 @@ describe('metadata', function() { expect(isEmptyObj(metadata.getAll())).toEqual(true); }); + it('should gracefully handle "junk" before the actual metadata (issue 10395)', + function() { + const data = '' + + '' + + '' + + '' + + 'PDFKit.NET 4.0.102.0' + + '' + + '1.7' + + '' + + '2018-12-27T13:50:36-08:00' + + '2018-12-27T13:50:38-08:00' + + '' + + '2018-12-27T13:50:38-08:00' + + '' + + '' + + '' + + '' + + '' + + '' + + 'application/pdf' + + ''; + const metadata = new Metadata(data); + + expect(isEmptyObj(metadata.getAll())).toEqual(true); + }); + it('should correctly handle metadata containing "&apos" (issue 10407)', function() { const data = '' +