Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ describe('contentDisposition(filename)', function () {
'attachment; filename="plans.pdf"')
})

it('should use the basename of a posix path with only slashes', function () {
assert.strictEqual(contentDisposition('///'),
'attachment; filename*=UTF-8\'\'')
})

it('should use the basename of a windows path with only slashes', function () {
assert.strictEqual(contentDisposition('\\\\\\'),
'attachment; filename*=UTF-8\'\'')
})

describe('when "filename" is US-ASCII', function () {
it('should only include filename parameter', function () {
assert.strictEqual(contentDisposition('plans.pdf'),
Expand Down