Skip to content

Commit

Permalink
chore(mix): Return an error if the requested range is too large
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Jan 26, 2025
1 parent 7848cc2 commit b5978db
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/handlers/mix.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ func (m *Mix) Mix() func(*core.RequestEvent) error { //nolint:gocyclo
if chunkStart, err = strconv.Atoi(first); err != nil {
return apis.NewApiError(http.StatusRequestedRangeNotSatisfiable, "", nil)
}

// Error if too large
if chunkStart >= int(m.conf.MixTotalSize) {
return apis.NewApiError(http.StatusRequestedRangeNotSatisfiable, "", nil)
}
}

chunkSize := int(m.conf.MixChunkSize) + entry.Writer.Buffered()
Expand Down

0 comments on commit b5978db

Please sign in to comment.