152
// decodeLink decodes the Nexus-Link header values.
153
// It must have the same format of HTTP Link header: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Link
155
>
var link nexus.Link
156
>
encodedLink = strings.TrimSpace(encodedLink)
157
>
if len(encodedLink) == 0 {
158
return link, errors.New("failed to parse link header: value is empty")
159
}
160
162
>
return link, fmt.Errorf("failed to parse link header: invalid format: %s", encodedLink)
api.go
163
>
}
164
urlEnd := strings.Index(encodedLink, ">")
165
if urlEnd == -1 {