Repository: DefGuard/defguard (language: rust)

Issue:
Downloading a wireguard conf on mobile makes the file end with .txt instead of .conf
**Describe the bug**
When you create a new wireguard VPN device on an android device using either Chrome or Firefox and download the wireguard conf file it ends with .txt instead of .conf like it does when downloaded on a desktop operating system. This causes issues with the wireguard android app which wants the file to end with .conf

**To Reproduce**
Steps to reproduce the behavior:
1. Login to your defguard account on an android device
2. Create a new device
3. Select it to be a Wireguard client
4. Get to the page with the QR Code
5. Download the wireguard conf

**Expected behavior**
For the file to end with .conf like it does when downloaded on a desktop PC OS.

**Version information**
- Defguard Core version: v0.9.1
- Defguard Gateway version: 
  - Android (Probably IOS to but can't test)
 - Mobile Chrome or Firefox 



Discussion / hints:
This seems to be an issue with the browser itself ([1](https://issues.chromium.org/issues/40943408), [2](https://github.com/eligrey/FileSaver.js/issues/785), [3](https://apple.stackexchange.com/questions/95362/save-a-file-with-the-extension-i-want)). A possible workaround for it would be to change the MIME type of the config file from `text/plain` to something like `application/octet-stream` (which may make it impossible to open with some built-in text viewers) or some custom type, like `text/conf`.

Fix patch:
diff --git a/web/src/shared/utils/downloadWGConfig.ts b/web/src/shared/utils/downloadWGConfig.ts
index f3c357d0f..b395a0768 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`);
 };


Test patch: