Skip to content

Commit

Permalink
Support application/force-download
Browse files Browse the repository at this point in the history
  • Loading branch information
MorbZ committed Jun 7, 2019
1 parent 2012edd commit 0e1724b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "No PDF Download",
"description": "Opens all PDF files directly in the browser.",
"version": "1.0.5",
"version": "1.0.6",

"permissions": [
"webRequest",
Expand Down
1 change: 1 addition & 0 deletions app/src/headers.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const PDF_MIME_TYPES = [
];
const BINARY_MIME_TYPES = [
'application/octet-stream',
'application/force-download',
'binary/octet-stream',
];
const HEADER_CONTENT_DISPOSITION = 'Content-Disposition';
Expand Down
4 changes: 2 additions & 2 deletions test/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ describe('Handle Headers', () => {
['Content-Disposition', 'inline'],
]);

testHandleHeaders('Binary/Octet-stream with PDF file name(s)', 'http://test.com/02000', [
testHandleHeaders('Application/Force-Download with PDF file name(s)', 'http://test.com/02000', [
['Content-Disposition', 'attachment; filename="ABC_2019.pdf"; filename*=UTF-8\'\'ABC_2019.pdf'],
['Content-Type', 'binary/octet-stream'],
['Content-Type', 'application/force-download'],
], [
['Content-Disposition', 'inline; filename="ABC_2019.pdf"; filename*=UTF-8\'\'ABC_2019.pdf'],
['Content-Type', 'application/pdf'],
Expand Down

0 comments on commit 0e1724b

Please sign in to comment.