Skip to content

Commit

Permalink
return 0 and never null in header
Browse files Browse the repository at this point in the history
  • Loading branch information
anna-parker committed Sep 11, 2024
1 parent 8d51e5c commit 679ec99
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,11 @@ class SubmissionController(
.mapNotNull { it[UpdateTrackerTable.lastTimeUpdatedDbColumn] } // Extract non-null datetime values
.maxOrNull()?.toTimestamp() // Find the maximum value
}
val lastModified: Long = lastTime ?: 0

if ((lastTime == null) || (ifModifiedSince == null) || (lastTime!! > ifModifiedSince)) {
val streamBody = streamTransactioned(compression) { releasedDataModel.getReleasedData(organism) }
headers.add(HttpHeaders.LAST_MODIFIED, lastTime.toString())
headers.add(HttpHeaders.LAST_MODIFIED, lastModified.toString())
return ResponseEntity(streamBody, headers, HttpStatus.OK)
} else {
return ResponseEntity.status(HttpStatus.NOT_MODIFIED).build()
Expand Down

0 comments on commit 679ec99

Please sign in to comment.