mirror of
https://github.com/paricafe/misskey.git
synced 2025-01-07 06:00:50 -06:00
311c2172d7
This reverts commit 9b5aeb76d8
.
11 lines
345 B
TypeScript
11 lines
345 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
import cd from 'content-disposition';
|
|
|
|
export function contentDisposition(type: 'inline' | 'attachment', filename: string): string {
|
|
const fallback = filename.replace(/[^\w.-]/g, '_');
|
|
return cd(filename, { type, fallback });
|
|
}
|