1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-25 12:45:18 +01:00

add safari to download function

This commit is contained in:
Kyle Spearrin 2018-02-21 12:26:18 -05:00
parent 8c2f629174
commit 88fd1d8cb3

View File

@ -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.");
}