Speed up artifact downloads
This commit is contained in:
@@ -94,8 +94,12 @@ func ValidateArtifactContent(content domain.ArtifactContent) error {
|
||||
if content.TotalSizeBytes <= 0 {
|
||||
violations = append(violations, "totalSizeBytes must be positive")
|
||||
}
|
||||
if content.SizeBytes > MaxArtifactDownloadBytes {
|
||||
violations = append(violations, fmt.Sprintf("sizeBytes must not exceed %d", MaxArtifactDownloadBytes))
|
||||
maxContentBytes := int64(MaxArtifactDownloadBytes)
|
||||
if !content.Partial {
|
||||
maxContentBytes = MaxArtifactBytes
|
||||
}
|
||||
if content.SizeBytes > maxContentBytes {
|
||||
violations = append(violations, fmt.Sprintf("sizeBytes must not exceed %d", maxContentBytes))
|
||||
}
|
||||
if int64(len(content.Payload)) != content.SizeBytes {
|
||||
violations = append(violations, "payload size must match sizeBytes")
|
||||
|
||||
Reference in New Issue
Block a user