1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-04 01:22:50 -05:00

[EC-584] Add TryParse to ClientVersion due to QA builds having an appended git hash (#2395)

* [EC-584] Add TryParse to ClientVersion due to QA builds having an appended git hash

* [EC-584] Add string.Split to only get 'ClientVersion' number when the input value includes the git hash

* Revert "[EC-584] Add string.Split to only get 'ClientVersion' number when the input value includes the git hash"

This reverts commit 9ebad69c6a.

* [EC-584] Update client version check to 2022.12

* [EC-584] Inverted check on ClientVersion

* [EC-584] Bumped version check to version 2023.01

* [EC-584] Removed the 0 prefix from the client version check
This commit is contained in:
Rui Tomé
2022-12-06 15:35:05 +00:00
committed by GitHub
parent f173988979
commit fe59186c96
2 changed files with 12 additions and 12 deletions

View File

@ -82,9 +82,9 @@ public class CurrentContext : ICurrentContext
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;
}
}