Skip to content

You're viewing documentation for a pre-release version. View the latest stable version

Instance Method

asResponseContentRange(limit:)

Converts this HTTPFields.Range.Value to a HTTPFields.ContentRange.Value with the given limit.
func asResponseContentRange(limit: Int) throws -> HTTPFields.ContentRange.Value

Discussion

The returned range is the one that will actually be served: an end past limit is clamped to the last byte rather than reflected back verbatim.

Throws

Abort .badRequest if the range is malformed, or .rangeNotSatisfiable if it selects no bytes of a representation of length limit.