Quellcode durchsuchen

Broaden an error condition

`http.ErrNoCookie` isn't the only possible error value.
jvoisin vor 1 Jahr
Ursprung
Commit
60e1d9e361
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  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.
 // CookieValue returns the cookie value.
 func CookieValue(r *http.Request, name string) string {
 func CookieValue(r *http.Request, name string) string {
 	cookie, err := r.Cookie(name)
 	cookie, err := r.Cookie(name)
-	if err == http.ErrNoCookie {
+	if err != nil {
 		return ""
 		return ""
 	}
 	}