diff --git a/web/src/shared/utils/downloadWGConfig.ts b/web/src/shared/utils/downloadWGConfig.ts index f3c357d0f2..b395a0768e 100644 --- a/web/src/shared/utils/downloadWGConfig.ts +++ b/web/src/shared/utils/downloadWGConfig.ts @@ -2,7 +2,9 @@ import saveAs from 'file-saver'; export const downloadWGConfig = (config: string, fileName: string) => { const blob = new Blob([config.replace(/^[^\S\r\n]+|[^\S\r\n]+$/gm, '')], { - type: 'text/plain;charset=utf-8', + // octet-stream is used here as a workaround: some browsers will append + // an additional .txt extension to the file name if the MIME type is text/plain. + type: 'application/octet-stream', }); saveAs(blob, `${fileName.toLowerCase()}.conf`); };