mirror of
https://github.com/bitwarden/server.git
synced 2024-12-26 17:37:36 +01:00
Seek to origin of MemoryStream before use (#1916)
This commit is contained in:
parent
a964dfd774
commit
eee5caf1f8
@ -265,12 +265,14 @@ namespace Bit.Admin.Controllers
|
||||
model.InstallationId.Value, model.Version);
|
||||
var ms = new MemoryStream();
|
||||
await JsonSerializer.SerializeAsync(ms, license, JsonHelpers.Indented);
|
||||
ms.Seek(0, SeekOrigin.Begin);
|
||||
return File(ms, "text/plain", "bitwarden_organization_license.json");
|
||||
}
|
||||
else if (user != null)
|
||||
{
|
||||
var license = await _userService.GenerateLicenseAsync(user, null, model.Version);
|
||||
var ms = new MemoryStream();
|
||||
ms.Seek(0, SeekOrigin.Begin);
|
||||
await JsonSerializer.SerializeAsync(ms, license, JsonHelpers.Indented);
|
||||
return File(ms, "text/plain", "bitwarden_premium_license.json");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user