mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-07-25 23:44:57 +02:00
* deps: update dependencies * fix archiver types not updated * spdx * update archiver types * update deps * fix test
20 lines
789 B
TypeScript
20 lines
789 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
import { describe, expect, test } from 'vitest';
|
|
import { contentDisposition } from '@/misc/content-disposition.js';
|
|
|
|
describe('misc:content-disposition', () => {
|
|
test('inline', () => {
|
|
expect(contentDisposition('inline', 'foo bar')).toMatch(/^inline; filename="?foo_bar"?; filename\*=UTF-8''foo%20bar$/);
|
|
});
|
|
test('attachment', () => {
|
|
expect(contentDisposition('attachment', 'foo bar')).toMatch(/^attachment; filename="?foo_bar"?; filename\*=UTF-8''foo%20bar$/);
|
|
});
|
|
test('non ascii', () => {
|
|
expect(contentDisposition('attachment', 'ファイル名')).toMatch(/^attachment; filename="?_____"?; filename\*=UTF-8''%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E5%90%8D$/);
|
|
});
|
|
});
|