Преглед изворни кода

Broaden an error condition

`http.ErrNoCookie` isn't the only possible error value.
jvoisin пре 1 година
родитељ
комит
60e1d9e361
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      internal/http/request/cookie.go

+ 1 - 1
internal/http/request/cookie.go

@@ -8,7 +8,7 @@ import "net/http"
 // CookieValue returns the cookie value.
 func CookieValue(r *http.Request, name string) string {
 	cookie, err := r.Cookie(name)
-	if err == http.ErrNoCookie {
+	if err != nil {
 		return ""
 	}