Explorar o código

Broaden an error condition

`http.ErrNoCookie` isn't the only possible error value.
jvoisin hai 1 ano
pai
achega
60e1d9e361
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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 ""
 	}