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:
parent
6c03f819bd
commit
2aac0585f4
3
main.go
3
main.go
|
@ -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 "", ""
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user