mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 16:12:49 -05:00
[EC-584] Add TryParse to ClientVersion due to QA builds having an appended git hash
This commit is contained in:
@ -42,7 +42,7 @@ public class OrganizationExportController : Controller
|
|||||||
(IEnumerable<CipherOrganizationDetails> orgCiphers, Dictionary<Guid, IGrouping<Guid, CollectionCipher>> collectionCiphersGroupDict) = await _cipherService.GetOrganizationCiphers(userId, organizationId);
|
(IEnumerable<CipherOrganizationDetails> orgCiphers, Dictionary<Guid, IGrouping<Guid, CollectionCipher>> collectionCiphersGroupDict) = await _cipherService.GetOrganizationCiphers(userId, organizationId);
|
||||||
|
|
||||||
// Backward compatibility with versions before 2022.11.0 that use ListResponseModel
|
// Backward compatibility with versions before 2022.11.0 that use ListResponseModel
|
||||||
if (_currentContext.ClientVersion < new Version("2022.11.0"))
|
if (_currentContext.ClientVersion != null && _currentContext.ClientVersion < new Version("2022.11.0"))
|
||||||
{
|
{
|
||||||
var organizationExportListResponseModel = new OrganizationExportListResponseModel
|
var organizationExportListResponseModel = new OrganizationExportListResponseModel
|
||||||
{
|
{
|
||||||
|
@ -82,9 +82,9 @@ public class CurrentContext : ICurrentContext
|
|||||||
MaybeBot = httpContext.Request.Headers["X-Cf-Maybe-Bot"] == "1";
|
MaybeBot = httpContext.Request.Headers["X-Cf-Maybe-Bot"] == "1";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (httpContext.Request.Headers.ContainsKey("Bitwarden-Client-Version"))
|
if (httpContext.Request.Headers.ContainsKey("Bitwarden-Client-Version") && Version.TryParse(httpContext.Request.Headers["Bitwarden-Client-Version"], out var cVersion))
|
||||||
{
|
{
|
||||||
ClientVersion = new Version(httpContext.Request.Headers["Bitwarden-Client-Version"]);
|
ClientVersion = cVersion;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user