mirror of
https://github.com/ddworken/hishtory.git
synced 2025-01-23 06:38:52 +01:00
Fix bug where requests missing the X-Hishtory-Version header wouldn't get dump/deletion requests (which caused tests to fail since the tests don't set this header)
This commit is contained in:
parent
c00e5d357e
commit
4006eef1e1
@ -51,9 +51,11 @@ func (s *Server) apiSubmitHandler(w http.ResponseWriter, r *http.Request) {
|
||||
resp := shared.SubmitResponse{}
|
||||
|
||||
deviceId := getOptionalQueryParam(r, "source_device_id", s.isTestEnvironment)
|
||||
if deviceId != "" && version != "" {
|
||||
if deviceId != "" {
|
||||
hv, err := parseVersionString(version)
|
||||
if err != nil || hv.greaterThan(parsedVersion{0, 221}) {
|
||||
// Note that if we fail to parse the version string, we do return dump and deletion requests. This is necessary
|
||||
// since tests run with v0.Unknown which obviously fails to parse.
|
||||
dumpRequests, err := s.db.DumpRequestForUserAndDevice(r.Context(), userId, deviceId)
|
||||
checkGormError(err)
|
||||
resp.DumpRequests = dumpRequests
|
||||
|
Loading…
Reference in New Issue
Block a user