mavcaldav: name the shared response-body read cap (V-581)
fetchEvents and listPublished both bounded their HTTP body reads at 4<<20 with no name for what the number was for. One constant, maxResponseBody, documents the reason (cap every CalDAV response this daemon reads) once instead of twice. No functional change.
This commit is contained in:
@@ -142,7 +142,7 @@ func (r *renderer) listPublished(ctx context.Context) ([]int64, error) {
|
||||
return nil, err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
raw, err := io.ReadAll(io.LimitReader(resp.Body, 4<<20))
|
||||
raw, err := io.ReadAll(io.LimitReader(resp.Body, maxResponseBody))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user