We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5271e76 commit 2d25bf7Copy full SHA for 2d25bf7
web/src/shared/utils/downloadWGConfig.ts
@@ -2,7 +2,9 @@ import saveAs from 'file-saver';
2
3
export const downloadWGConfig = (config: string, fileName: string) => {
4
const blob = new Blob([config.replace(/^[^\S\r\n]+|[^\S\r\n]+$/gm, '')], {
5
- type: 'text/plain;charset=utf-8',
+ // octet-stream is used here as a workaround: some browsers will append
6
+ // an additional .txt extension to the file name if the MIME type is text/plain.
7
+ type: 'application/octet-stream;charset=utf-8',
8
});
9
saveAs(blob, `${fileName.toLowerCase()}.conf`);
10
};
0 commit comments