fix param parse when param has no value

defination: [rfc5988](https://tools.ietf.org/html/rfc5988#section-5) - link-extension
This commit is contained in:
Friparia 2018-08-29 16:32:12 +08:00 committed by GitHub
parent 6c03f819bd
commit 2aac0585f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -136,6 +136,9 @@ func ParseMultiple(headers []string) Links {
func parseParam(raw string) (key, val string) {
parts := strings.SplitN(raw, "=", 2)
if len(parts) == 1 {
return parts[0], ""
}
if len(parts) != 2 {
return "", ""
}