浏览代码

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 ""
 	}