getSessionKeyFromCookie reads and returns a session key from the cookie sent by the request. If no session key is found, it returns an empty string
(r *http.Request)
| 94 | // getSessionKeyFromCookie reads and returns a session key from the cookie sent by the |
| 95 | // request. If no session key is found, it returns an empty string |
| 96 | func getSessionKeyFromCookie(r *http.Request) (string, error) { |
| 97 | c, err := r.Cookie("id") |
| 98 | |
| 99 | if err == http.ErrNoCookie { |
| 100 | return "", nil |
| 101 | } else if err != nil { |
| 102 | return "", errors.Wrap(err, "reading cookie") |
| 103 | } |
| 104 | |
| 105 | return c.Value, nil |
| 106 | } |
| 107 | |
| 108 | type authHeader struct { |
| 109 | scheme string |
no outgoing calls