v0.4.0
What's Changed
This is a breaking change as the signature of CheckFormat()
has changed from func(*net/http.Request) (ContentType, error)
to func(*net/http.Request) ([]ContentType, error)
; i.e. it now returns a slice of ContentType
object. This slice is priority ordered and only contains compatible content types for Trustless Gateway requests but they may be either requests for a CAR or a Raw block. The content types come from either the Accept
request header or the format
parameter. It should be safe for a caller to select the first supportable format from the list; i.e. if a caller can support both CAR and Raw responses, choose the first element of the slice (where there is no error, the slice will always be of length >= 1).
ContentType
now has IsCar() bool
and IsRaw() bool
.
Full Changelog: v0.3.1...v0.4.0