Merge pull request #5 from friparia/master

fix param parse when param has no value
This commit is contained in:
Tom Hudson 2018-09-05 15:39:41 +01:00 committed by GitHub
commit 3eda75a91f
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) { func parseParam(raw string) (key, val string) {
parts := strings.SplitN(raw, "=", 2) parts := strings.SplitN(raw, "=", 2)
if len(parts) == 1 {
return parts[0], ""
}
if len(parts) != 2 { if len(parts) != 2 {
return "", "" return "", ""
} }