diff --git a/util/Function/Download.cs b/util/Function/Download.cs index e5260979e8..dff2c89faf 100644 --- a/util/Function/Download.cs +++ b/util/Function/Download.cs @@ -31,6 +31,10 @@ namespace Bit.Function const string DesktopLinuxFreeBsdFileName = "bitwarden-{0}.freebsd"; const string DesktopLinuxSnapUrl = "https://snapcraft.io/"; + // Browser + const string BrowserSafariFileUrl = "https://cdn.bitwarden.com/safari-extension/bitwarden-1.24.1.safariextz"; + const string BrowserSafariStoreUrl = "https://safari-extensions.apple.com"; + [FunctionName("Download")] public static HttpResponseMessage Run( [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "api/download")]HttpRequestMessage req, @@ -115,6 +119,20 @@ namespace Bit.Function } } } + else if(app == "browser") + { + if(platform == "safari") + { + if(variant == null || variant == "safariextz") + { + return GetRedirectResponse(req, BrowserSafariFileUrl); + } + else if(variant == "store") + { + return GetRedirectResponse(req, BrowserSafariStoreUrl); + } + } + } return req.CreateResponse(HttpStatusCode.NotFound, "Download not found."); }